Recently I've done huge migration from hibernate-search-3.0.0.GA to hibernate-search-orm-5.6.1.Final. In our project we have a lot of @Indexed entities and quite sophisticated hierarchy. There's abstract @Indexed @MappedSuperclass which has @Indexed subclasses. Simplifying thing it could be written like following:
I found it very interesting, that after switch all the entities started to be populated in the index for class (we're using FSDirectoryProvider as a provider) A, even though I'm trying to index B instances. Quick analysis shows, that during creation of IndexManagerGroupHolder there's wrong name passed as first argument for org.hibernate.search.indexes.impl.IndexManagerHolder#getOrCreateGroupHolder. Following that further one could see, that in org.hibernate.search.indexes.impl.IndexManagerHolder#getIndexName there appears to be index name evaluation:
which then followed by return statement:
If I do get comment before the loop right, this method should return the most specific index name either from @Index.name or fully-qualified class name of the @Indexed entity.
Question is is my understanding correct? If so that in my case, when indexing subclass B I should get as an index name fully qualified name of class B. Problem is, that I get fqcn of A instead.
Problem appears to be serious, when one's using exclusive_index_use=true, which is default now.