How to sort on analyzed/tokenized field in Elasticsearch? How to sort on analyzed/tokenized field in Elasticsearch? elasticsearch elasticsearch

How to sort on analyzed/tokenized field in Elasticsearch?


You can use the built in concept of Multi Field Type in Elasticsearch.

The multi_field type allows to map several core_types of the same value. This can come very handy, for example, when wanting to map a string type, once when it’s analyzed and once when it’s not_analyzed.

In the Elasticsearch Reference, please look at the String Sorting and Multi Fields guide on how to setup what you need.

Please note that Multi Field mapping configuration has changed between Elasticsearch 0.90.X and 1.X. Use the appropriate following guide based on your version: