OpenSearch/docs/reference/query-dsl/and-query.asciidoc

35 lines
809 B
Plaintext

[[query-dsl-and-query]]
=== And Query
deprecated[2.0.0, Use the `bool` query instead]
A query that matches documents using the `AND` boolean operator on other
queries.
[source,js]
--------------------------------------------------
{
"filtered" : {
"query" : {
"term" : { "name.first" : "shay" }
},
"filter" : {
"and" : [
{
"range" : {
"postDate" : {
"from" : "2010-03-01",
"to" : "2010-04-01"
}
}
},
{
"prefix" : { "name.second" : "ba" }
}
]
}
}
}
--------------------------------------------------