Allow looking up the capabilities of each field in the metamodel

Description

I.e. we need a way to know which predicates/sorts/projections/etc. are available for a given field. This will make it possible to implement something similar to jpamodelgen, where classes are generated at compile-time to represent the index metamodel and can be used in the Search DSL (something that's been requested before).

There was (limited) support for that in Search 5, through org.hibernate.search.metadata.FieldSettingsDescriptor#getType, org.hibernate.search.metadata.FieldSettingsDescriptor#getIndex, org.hibernate.search.metadata.FieldSettingsDescriptor#getStore.

An interesting way to implement this would be through a hasCapability(String) methods, where the string is the name of a given capability: match predicate, "within circle" predicate, "field value" sort, "distance" sort, ... Names would be exposed as constants in some BuiltinCapabilities class, and more importantly *each backend could define additional constants for its extended capabilities*. This would be very similar to what is described in for field configuration.

This ticket is a follow-up on HSEARCH-3589.

Activity

Show:

Yoann Rodière November 28, 2023 at 4:03 PM

This would be useful for Infinispan, in order to check whether Ickle syntax constructs make sense for a given field.

Fixed

Details

Assignee

Reporter

Components

Sprint

Fix versions

Priority

Created May 4, 2020 at 9:36 AM
Updated January 24, 2024 at 2:23 PM
Resolved December 14, 2023 at 10:12 AM