Query get documents by giving an array of document ids same order of array


I am a beginner with Elasticsearch and my application is using it for monitoring and search engine.I am currently using ES 5.6.4.

I would like to know if it's possible to get documents by giving an array of documents ids to my ES Query and get it in the same order of the array. If that's possible, what would be the syntax?

I have an example here, the goal is to get these documents in the same order as the list:

GET connect-dev/_search
  "query": { 
    "bool": { 
        { "terms": { "_id" : ["elitevideos-367",
            "comments-239393"] }}
  "size": 20,
  "from": 0

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