The {{org.hibernate.search.bridge.impl.BridgeFactory.getContainerType(XMember, ReflectionManager)}} method, responsibly responsible for determining the container type which will be used among others in {{org.hibernate.search.bridge.impl.BridgeFactory.getFieldBridgeFromBridgeProvider(BridgeProvider, ExtendedBridgeProviderContext, ContainerType)}}, relies on an {{@IndexedEmbedded}} annotation being present on the property.
This means in particular that array/iterable/map field bridges will only be affected to a property if this property carries both a {{@Field}} and a {{@IndexedEmbedded}} annotation.
**But** when you want to index an array of strings, for instance, putting an {{@IndexedEmbedded}} annotation on the property makes no sense, because the purpose of this annotation is to "allow[...] queries involving associated objects properties". Also, the documentation exclusively refers to this annotation in the context of {{@Embeddable}}s or entities, with no word about array bridges.
Maybe we should drop this requirement of having an {{@IndexedEmbedded}} annotation for the array/iterable/map bridge to be affected correctly? This will probably require some changes the the {{@IndexedEmbedded}} code, to make sure that the container type will be ignored if the {{@IndexedEmbedded}} is absent. |
|