Hi, Hibernate Search under Infinispan does not differ when it comes to annotation processing. Is there a reason why entity A is not annotated with @Indexed as well?
I'll explain why this is so:
The Hibernate Seach docs don't mention that explicitly, however this article (and a few others) say that @Indexed should only be applied to the concrete class that is indexed / stored, whereas any @Field annotations present in super classes should be automatically picked up.
Just in case, I tried adding @Indexed to the super class, but the exact same exception keeps coming up.
This made me think that Infinispan could be augmenting the default annotation behaviour of Hibernate Search.
What is the Infinispan version and what is the query being done?
The test was done with 8.1.2.Final. But we intend to move into 8.2 now that it's released. We really like the new features of 8!
This is the query, where subject is the search argument:
QueryFactory qf = org.infinispan.query.Search.getQueryFactory(cache);
org.infinispan.query.dsl.Query query = qf.from(AuthorizationRecord.class)
It seems the Infinispan native DSL has issues with inheritance. If you try to use a Hibernate Search query, it should work:
SearchManager searchManager = Search.getSearchManager(cache); QueryBuilder queryBuilder = searchManager.buildQueryBuilderForClass(Child.class).get(); Query luceneQuery = queryBuilder.keyword().onField("subject").matching(subject).createQuery(); CacheQuery cacheQuery = searchManager.getQuery(luceneQuery, Child.class); List<Object> list = cacheQuery.list();
I've created a JIRA to track this: [ISPN-6362] Infinispan Query DSL parser failure with inheritance - JBoss Issue Tracker
Thanks a lot! I can confirm that after switching to the native Hibernate Search query the inheritance of the @Field annotations worked, and all our tests passed.
I was at your JBug talk on v8, and we're now trying out the new features that you presented. In case we encounter problems I'll post here or on the tracker so you can have a chance to make the new bits more stable.