Search code examples
elasticsearchelasticsearch-7

ElasticSearch [field_sort] unknown field [format]


I'm adding a sort conditions field to my ElasticSearch query. I'm using ES 7.14 / Kibana 7.10. My sort array field look like

[
                    
    { "update_date": { "order": "desc", "missing" : "_last", "unmapped_type" : "long", "format": "strict_date_optional_time_nanos" } },
    { "release_date": { "order": "desc", "missing" : "_last", "unmapped_type" : "long", "format": "strict_date_optional_time_nanos" } }
]

where I have used: desc ordering, _last for missing values; long for unmapped_type, and strict_date_optional_time_nanos for format. The query builder complains that

node:15873) UnhandledPromiseRejectionWarning: Error: [x_content_parse_exception] [1:275] [field_sort] unknown field [format]

despite of the format field is available in ES 7.14. If I remove the format field, it works, but I have no control over the sorting fields I'm using. So how to specify the sorting fields format?


Solution

  • This is because the format parameter was released in 7.13 so your Kibana 7.10 doesn't know about it and hence complains when sending the query.

    You should always keep your component versions in synch when upgrading to prevent incompatibilities such as the one you describe from happening.

    So the solution is simple: upgrade Kibana to 7.14.