This is the basic SQL query which I want to convert into elasticsearch query,
SELECT product
FROM products
WHERE (price = 200 OR ID = "101")
AND (price != 300)
This is a query in elasticsearch that I have tried:
GET /my_store/my_product_items/_search
{
"query" : {
"constant_score" : {
"filter" : {
"bool" : {
"must" : [
{ "term" : {"price" : 200}},
{ "term" : {"productID" : "101"}}
],
"must_not" : {
"term" : {"price" : 300}
}
}
}
}
}
}
But it didn't give the same output as per SQL query. Do support.
TIA. :)