if suppose i want to write query like
select * from xyz where a="abc" and (createdDate between "?" and aprovedDate betwenn "?")
My intention is to write Query Builder query using this.
if suppose i want to write query like
select * from xyz where a="abc" and (createdDate between "?" and aprovedDate betwenn "?")
My intention is to write Query Builder query using this.
you need a bool query, that contains three must clauses. One is a term query for the a field and the other two are range queries. you can use the QueryBuilders class to create those queries.
See https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-search.html
a="abc " this condition always execute no matter what other condition is. Your solution is not creating proper query which is expected.
For eg:
select * from m_country where approval_status="SAVED" or (created_date= "2017-12-30" or approved_date ="2017-12-30")
Status result should be there other date related condition can be "AND" or "OR" no matter.
© 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.