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.
Actually the comment states:
Your case is the second one, because you are using the default index name: you used @Indexed and not @Indexed(index = "myIndexName"). So the method should return "the name from the most generic @Indexed class in the hierarchy", and from what you are saying it does. Generally speaking, @Indexed is only useful to tell Hibernate Search which index instances of this class should be stored in. You don't need it in abstract superclasses of classes you want to see indexed, in particular, or in contained classes. The @Field annotations of superclasses of your @Indexed-annotated classes will be taken into account as appropriate. |