Elasticsearch how Set fielddata=true

WHen we try to sort on articleNumber, we get this error. How can I control the mappings?

“error”: {
“root_cause”: [
“type”: “illegal_argument_exception”,
“reason”: “Fielddata is disabled on text fields by default. Set fielddata=true on [articleNumber] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.”

Litium version: 7.4.2

In the Litium.Accelerator.Elasticsearch project for the accelerator the configuration of the different indices exists.

Example the file ProductDocument contains the field and the settings for the products that are indexed. For each property the index option and how they should behave are made with the attributes from the Nest-namespace. Example the Keyword-attribute tell the system that a keyword analyzer should be used or the Nested-attribute to make the items child-documents to the current document.

The index setting can also be set by fluent code in the ProductIndexConfiguration if the attributes not support what you want to do.

If you have an Litium installation up and running with Elasticsearch and you delete the index from Elasticsearch, when the first item should be indexed again for this index the index is created without the settings and index mapping. To correct this you need to stop Litium and then remove the index in Elasticsearch again. When Litium now try to reach the index it is created correctly again with the correct settings and index mapping.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.