How would I build a OR query for field exists

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.