2015-05-05 02:27:52 -04:00
|
|
|
[[query-dsl-or-query]]
|
|
|
|
== Or Query
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2015-05-05 02:27:52 -04:00
|
|
|
deprecated[2.0.0, Use the `bool` query instead]
|
2015-04-09 12:33:27 -04:00
|
|
|
|
2015-05-05 02:27:52 -04:00
|
|
|
A query that matches documents using the `OR` boolean operator on other
|
|
|
|
queries.
|
2013-08-28 19:24:34 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"filtered" : {
|
|
|
|
"query" : {
|
|
|
|
"term" : { "name.first" : "shay" }
|
|
|
|
},
|
|
|
|
"filter" : {
|
|
|
|
"or" : [
|
|
|
|
{
|
|
|
|
"term" : { "name.second" : "banon" }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"term" : { "name.nick" : "kimchy" }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|