Do I need to turn analyzer off for match all query?

I want to get the latest record added to ElasticSearch.

If I use a query like this:

{
  "query": {
    "match_all": {}
  },
  "size": 1,
  "sort": [
    {
      "_timestamp": {
        "order": "desc"
      }
    }
  ]
}

Would ElasticSearch score all the documents based on relevance? I mean do I need to explicitly tell ElasticSearch that "Do not analyze/score" match_all query to improve the performance?

Hi,

no, the match_all query does not score documents.

Daniel

1 Like

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