Sql query
SELECT * FROM USER_DB WHERE (NAME IN('BABU DEV', 'NIKHIL') OR AGE IN(23,45)) AND COUNTRY = 'INDIA' AND STATE ='DELHI';
Sql query
SELECT * FROM USER_DB WHERE (NAME IN('BABU DEV', 'NIKHIL') OR AGE IN(23,45)) AND COUNTRY = 'INDIA' AND STATE ='DELHI';
What about this?
{
"query": {
"bool": {
"should": [
{ "terms": { "NAME": [ "BABU DEV", "NIKHIL" ] } },
{ "terms": { "AGE": [ 23, 45 ] } }
],
"minimum_should_match": 1,
"must": [
{ "term": { "COUNTRY": "INDIA" } },
{ "term": { "STATE": "DELHI" } }
]
}
}
}
This API can help you with the conversion: SQL Translate API | Elasticsearch Guide [7.17] | Elastic
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.