Infinispan 14 indexing & query news
source link: https://infinispan.org/blog/2022/06/14/infinispan-14-indexing-query-news
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Infinispan indexing annotations
Hibernate annotations are going to be replaced with the new Infinispan indexing annotations, that will be used in the same exact way for both embedded and remote queries.
Here is an example of two annotated POJOs:
Indexed fields without any special string/text transformation will be annotated as @Basic
.
If we need to apply a normalizer to a String field, we will opt for a @Keyword
annotation.
If we need to apply an analyzer to a String field, we will opt for a @Text
annotation.
The new annotations allow setting with the same annotation if the field should be sortable, or projectable, or its normalizer or its analyzer.
However, not all the combinations will be possible, for instance the attribute sortable is not present on the @Text
annotation,
since an analyzed field cannot be used to sort the result set.
indexNullAs
attribute allow now to define a default value to use on index in case the corresponding entity values was null.
Embedded indexes are defined using the @Embedded
annotation, and it is possible to choose between the NESTED
structure which
preserves the original object relationship structure and FLATTENED
structure which makes the leaf fields multi-valued
fields of the parent entity.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK