1 Reply Latest reply on Aug 16, 2010 10:01 AM by Emmanuel Bernard

    Another question on query API with JPA-like support

    Lin Ye Novice

      In the current 4.1 query API, searchable classes have to be annotated with Hibernate Search specific annotations, i.e. @ProvidedId, @Indexed, and @Field. When JPA-like API is introduced in 5.0, does it mean we don't need to use those Hibernate Search specific annotations any more? If so, when we annotate a class with @Entity but do NOT annotate it's attributes with @Field, how will its attributes get picked up for index? Will it pick up all the attributes by default? How to avoid certain attributes from being indexed for performance issue? I am asking this, as we want to hide the Hibernate Search specific API from our users by wrapping it up with some generic API, such as JPA as it will eventually be supported, and do the translation by ourselves at the moment. So we need this knowledge to understand how to do the translation.

        • 1. Re: Another question on query API with JPA-like support
          Emmanuel Bernard Master
          In theory we could analyze the static queries and transparently index the right properties (at least for non true full-text queries). Hibernate search can accept programmatically driven metadata (ie no annotation).
          But in practice we will very likely require people to provide the metadata anyway: it's easier for the first round and the analysis does not work for dynamic queries and true full-text queries. Provided we need some metadata, why not use the hsearch @annotations?