
上QQ阅读APP看书,第一时间看更新
Operator
By default, if the search term specified results in multiple terms after applying the analyzer, we need a way to combine the results from individual terms. As we saw in the preceding example, the default behavior of the match query is to combine the results using the or operator, that is, one of the terms has to be present in the document's field.
This can be changed to use the and operator using the following query:
GET /amazon_products/_search
{
"query": {
"match": {
"manufacturer": {
"query": "victory multimedia",
"operator": "and"
}
}
}
}
In this case, both the terms victory and multimedia should be present in the document's manufacturer field.