Change facet mapping to allow for broader encoding selection

Description

Currently, facet encoding is very lucene-specific and limited to either string or integer. But with other indexing services (such as Elasticsearch), other types may be needed (such as "date").
We should change the way facet mapping works, with those objectives in mind:

  • The whole solution should integrate well with Field Bridge 2.0 ( )

  • The main part of facet mapping should be independent of the indexing service

  • There should be a way for specific indexing service implementations to automatically derive encoding from the "generic" metadata

  • There should be a way for users to force using a different encoding? For instance with Lucene, we might want to use string encoding on integers from time to time. Maybe using a speicifc "NumberAsString" field bridge would do the trick: further investigation is required.

See also https://github.com/hibernate/hibernate-search/pull/1217#pullrequestreview-7709107

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure