How to improve performance of ID query

'Hi ,
I am new to Elasticsearch, I am trying to fetch documents from eleasticsearch using Id query .
Numbers of records in query are just 180 and query takes ~800 ms.

{
"profile" : "true",
"query": {
"ids" : {
"values" : ["3261", "3280", "5683", "5686", "6517", "6518", "19395", "19396", "19397", "19398", "19399", "19400", "19405", "19406", "19409", "19569", "19570", "100146", "100150", "104180", "104181", "104182", "104183", "500076", "500078", "500079", "500269", "500457", "500467", "500473", "601025", "601027", "601097", "601100", "601455", "601458", "601460", "601461", "601462", "601465", "620307", "620308", "620309", "620310", "700136", "700137", "700429", "700676", "700682", "704655", "704786", "704787", "704788", "705188", "705196", "705208", "705922", "705929", "766000", "766001", "766002", "766003", "766004", "837008", "837009", "861000", "861001", "896000", "896001", "896002", "896003", "899007", "1022000", "1022001", "1241000", "1256103", "1276000", "1276001", "1305115", "1305116", "1329100", "1332100", "1361101", "1361102", "1361103", "1361104", "1379100", "1379101", "1379102", "1379103", "1408105", "1408106", "1408107", "1408108", "1412102", "1412103", "1412104", "1412105", "1412106", "1478102", "1478103", "1494112", "1499100", "1499101", "1499102", "1499103", "1499104", "1499105", "1533101", "1533102", "1533103", "1541100", "1541101", "1542297", "1542298", "1542503", "1542504", "1543019", "1543020", "1543319", "1543320", "1544361", "1544362", "1544363", "1544364", "1544600", "1545333", "1545334", "1545718", "1545719", "1545782", "1545788", "1545806", "1545807", "1547521", "1547619", "1547620", "1547621", "1547622", "1547623", "1547624", "1547625", "1547626", "1547627", "1547628", "1547629", "1547630", "1547694", "1547784", "1547785", "1547786", "1547838", "1547839", "1547840", "1547841", "1547842", "1547843", "1548954", "1548955", "1548956", "1548957", "1548958", "1548959", "1548960", "1548961", "1548962", "1548963", "1548964", "1548965", "1548966", "1548967", "1548968", "1548969", "1548970", "1548971", "1548972", "1549428", "1549429", "1549430", "1549431", "1549432", "1549798", "1549926"]
}
}
}

Any idea how to minimize response time to ~200 ms?

Thanks'

Searches are broadcasted to all shards and executed.
A GET by document ID is routed directly to only the one shard that might contain that document.

For bulk gets check out the mget API

(Also, just in case you didn't already realise - profile:true is expensive)

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