The filtered
query has been deprecated and removed in ES 5.0. You should now use the bool/must/filter
query instead.
{
"query": {
"bool": {
"must": {
"multi_match": {
"operator": "and",
"fields": [
"author",
"title",
"publisher",
"year"
],
"query": "George Orwell"
}
},
"filter": {
"terms": {
"year": [
1980,
1981
]
}
}
}
}
}
Here are the differences between the two queries:
3,4c3,4
< "bool": {
< "must": {
---
> "filtered": {
> "query": {
6c6
< "operator": "and",
---
> "default_operator": "AND",
PS: the reference page you're looking at is located in the "deleted pages" of the appendix, so it's not part of the main documentation anymore.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…