We're updating the issue view to help you get more done. 

Multi-fields (backend-defined copies of fields using a slightly different type)

Description

See the Elasticsearch documentation: multi-fields

See also HSEARCH‌-2215

The idea is to define additional fields that take the same input as other fields, but transform/store it differently.
We could use a "source" or "derivedFrom" or "subFieldOf" attribute on @XXXField annotation:

1 2 @FullTextField(name = “myField”, bridge = …) @KeywordField(subFieldOf = "myField", name = "sort", sortable = Sortable.YES, normalizer = "sortNormalizer")

Note that we would have to forbid the definition of a bridge on such field, because the copy happens automatically in the backend.

The backend APIs could expose something like this:

1 2 3 schemaElement.field( "myField", f -> f.asLocalDate().toIndexFieldType() ) .subField( "sort", f -> f.asLocalDate().sortable( Sortable.YES ).normalizer( "sortNormalizer" ).toIndexFieldType() ) .createAccessor();

Or maybe a better API could be designed while we address HSEARCH‌-3444 .

Original discussion: https://docs.google.com/document/d/16PAa__LsxyLZcbW3q1MvgyIznh4ZnCYLupbNMXKMRds/edit#heading=h.gxh9craiaqrn

Environment

None

Status

Assignee

Unassigned

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Fix versions

Priority

Major