karmi / retire

A rich Ruby API and DSL for the Elasticsearch search engine
http://karmi.github.com/retire/
MIT License
1.87k stars 533 forks source link

Query DSL question #818

Open kapso opened 11 years ago

kapso commented 11 years ago

What would be the query DSL for the following query (these are all string queries)

country="US" AND locale="en" AND (text1="a" OR text2="a" OR text3="a*")

Also another question - Is it possible to do a OR between filters, if yes, how?

karmi commented 11 years ago

It's basically a boolean query with many mustss -- see https://github.com/karmi/tire/blob/master/test/integration/boolean_queries_test.rb

For filters, just use the or filter, https://github.com/karmi/tire/blob/master/test/integration/filters_test.rb#L39-L40