Hey all,
I've managed to create a query that searches for two fields, but both must exist. I'd like to build a query that requires field1 OR field2 to exist.
Any pointers? I can't find anything in the docs related to this.
Thanks!
Hey all,
I've managed to create a query that searches for two fields, but both must exist. I'd like to build a query that requires field1 OR field2 to exist.
Any pointers? I can't find anything in the docs related to this.
Thanks!
Under bool
, use should
instead of must
. That is the equivalent to an OR
See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html
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.