okfn/elasticsearch.js — pull request #8 by kielni (2013-10-25 16:14:59+00:00)
Title: create an ids query if queryInfo.ids is set with a list of document ids

I am using the Carrot2 plugin (https://github.com/carrot2/elasticsearch-carrot2). It returns document clusters, each with a list of document ids. I need to do a query with a list of document ids to get the actual documents. To do this, I added support for an ids query.

I set the list of ids like this:

this.model.queryState.set({ids: ["10869721","10833316","10849926","10913439"]});

which generates a query like this:

{
"query": {
"query": {
"ids": {
"values": [
"10869721",
"10833316",
"10849926",
"10913439"
]
}
}
},
"size": 4
}

This list can be very long, which is why I made the earlier change to make a POST request instead of GET.