Hi,
Let say my SQL query will be as follow:
SELECT A,B,C,D FROM TABLE1 WHERE A in ('a','b','c') AND B > 20
How can I write the elasticsearch query so that it works the same manner as the query above?
Hi,
Let say my SQL query will be as follow:
SELECT A,B,C,D FROM TABLE1 WHERE A in ('a','b','c') AND B > 20
How can I write the elasticsearch query so that it works the same manner as the query above?
Welcome!
You can try https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate.html to translate the original query to SQL.
Otherwise, you need probably here a bool
query with 2 must
clauses.
One clause would be a terms
query and the second clause a range
query.
Create a bool query with filter range and must should inside. Then use _source to select only which columns to return.
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.