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


(Hooman Bahreini) #1

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?


(Daniel Mitterdorfer) #2

Hi,

no, the match_all query does not score documents.

Daniel


(system) #3

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