Hello,
I have the following data set.
POST /my_store/products/_bulk
{ "index": { "_id": 1 }}
{ "price" : 10, "productID" : "XHDK-A-1293-#fJ3" }
{ "index": { "_id": 2 }}
{ "price" : 20, "productID" : "KDKE-B-9947-#kL5" }
{ "index": { "_id": 3 }}
{ "price" : 30, "productID" : "JODL-X-1937-#pV7" }
{ "index": { "_id": 4 }}
{ "price" : 30, "productID" : "QQPX-R-3956-#aD8" }
What is the difference between the two queries below as both of them returns the same result.
GET /my_store/products/_search
{
"query":{
"bool":{
"should":[
{"term":{"price":20}},
{"term":{ "productID" : "XHDK-A-1293-#fJ3"}}
],
"must_not":{
"term" : {"price" : 30}
}
}
}
}
GET /my_store/products/_search
{
"query":{
"constant_score": {
"filter": {
"bool":{
"should":[
{"term":{"price":20}},
{"term":{ "productID" : "XHDK-A-1293-#fJ3"}}
],
"must_not":{
"term" : {"price" : 30}
}
}
}
}
}
}
Thanks.