Version: 6.2.4
Documents: 1979484267
Shards: 30 in 30 hosts
Document sample:
{
"goods_id": 2466330584,
"cate_id": 6247,
"property_value_ids": []
}
What we want to do is query specified docs with _id(same as goods_id). which like
{
"_source": ["_id"],
"profile": false,
"query": {
"bool": {
"filter": [
{
"ids": {
"type": "goods",
"values": [
2035275709,
...
]
}
}
]
}
}
It's quite simple. It's about 1,000 ids per search request.
But it takes about 20ms!! If I decrease the ids size to 5, it takes ~5ms
So I try to profile them, it seems send all 1,000 ids to all shards without calculating where we belongs to, like sending [1, 3, 5] to shard 1, and [2, 4, 6] to shard 2.
Any idea to speed up this?
Thanks!