6 Replies Latest reply on Mar 10, 2016 7:06 AM by vdzhuvinov

    Super class fields not indexed for Hibernate Search

    vdzhuvinov

      We would like to index select fields of objects that we cache with Infinispan. We use the standard @Indexed and @Field annotations provided by Hibernate Search, as suggested in the online docs.

       

      For some reason we cannot get @Field annotated inherited methods to be indexed and we get the following exception when we do a search:

       

      org.hibernate.hql.ParsingException: ISPN000402: The type A has no property named 'subject'.

       

      This is the code:

       

      class A {

           String sub;

           @Field public String getSubject() { return sub; }

      }

       

      @Indexed

      class B extends A {

       

      }


      We also tried the programmatic API (org.hibernate.search.cfg.SearchMapping), but still get the same exception?

       

      Are we missing something here, or is inheritance generally not supported when dealing with Hibernate Search under Infinispan?

       

      Thanks,

       

      Vladimir