Documents I have like this
"hits" : [
{
"_index" : "products",
"_type" : "_doc",
"_id" : "8wE12HUB-VjXslma3jdp",
"_score" : 1.0,
"_source" : {
"product_id" : 85459
}
},
{
"_index" : "products",
"_type" : "_doc",
"_id" : "igE42HUB-VjXslmaD0K4",
"_score" : 1.0,
"_source" : {
"product_id" : 85765
}
},
{
"_index" : "products",
"_type" : "_doc",
"_id" : "2AE42HUB-VjXslmaZUOR",
"_score" : 1.0,
"_source" : {
"product_id" : 85807
}
},
{
"_index" : "products",
"_type" : "_doc",
"_id" : "pQE42HUB-VjXslmal0SO",
"_score" : 1.0,
"_source" : {
"product_id" : 85835
}
},
{
"_index" : "products",
"_type" : "_doc",
"_id" : "4gE52HUB-VjXslmal0hZ",
"_score" : 1.0,
"_source" : {
"product_id" : 82214
}
},
{
"_index" : "products",
"_type" : "_doc",
"_id" : "vwE92HUB-VjXslmarVoE",
"_score" : 1.0,
"_source" : {
"product_id" : 44148
}
},
{
"_index" : "products",
"_type" : "_doc",
"_id" : "DAE92HUB-VjXslma9Fw4",
"_score" : 1.0,
"_source" : {
"product_id" : 50521
}
},
{
"_index" : "products",
"_type" : "_doc",
"_id" : "vwE02HUB-VjXslmarjHh",
"_score" : 1.0,
"_source" : {
"product_id" : 85363
}
},
{
"_index" : "products",
"_type" : "_doc",
"_id" : "HwE42HUB-VjXslmaA0JC",
"_score" : 1.0,
"_source" : {
"product_id" : 85758
}
},
{
"_index" : "products",
"_type" : "_doc",
"_id" : "SQFd2HUB-VjXslmaK-CN",
"_score" : 1.0,
"_source" : {
"product_id" : 16524
}
}
]
I try with this query
GET products/_search?filter_path=hits.hits._source
{
"_source": [
"product_id"
],
"query": {
"bool": {
"must": [
{
"term": {
"product_to_show": {
"value": 1
}
}
},
{
"terms": {
"product_id": [
104477,
104474,
104473,
104472,
104471,
104470,
104468,
104467,
104466,
104465,
104464,
104463,
104462,
104460,
104459,
104457,
104456,
104454,
104453,
104452
]
}
}
]
}
}
}
}
Following result I get
{
"hits" : {
"hits" : [
{
"_source" : {
"product_id" : 104472
}
},
{
"_source" : {
"product_id" : 104471
}
},
{
"_source" : {
"product_id" : 104464
}
},
{
"_source" : {
"product_id" : 104459
}
},
{
"_source" : {
"product_id" : 104468
}
},
{
"_source" : {
"product_id" : 104474
}
},
{
"_source" : {
"product_id" : 104477
}
},
{
"_source" : {
"product_id" : 104456
}
},
{
"_source" : {
"product_id" : 104454
}
},
{
"_source" : {
"product_id" : 104460
}
}
]
}
}
I was expected missing ids to return for example in this query array of ids "104473" id is missing.