我正在尝试获取一个非常基本的过滤查询以与Elasticsearch一起使用。
{
"query": {
"bool": {
"must": {
"match_all": {}
},
"filter": {
"term": {
"name": "stanford designs"
}
}
}
}
}
最佳答案
奇怪的是,您的查询看起来还不错,但您可能正在使用某些旧版本的Elastics。
您可以在术语过滤器之前使用bool must,如下所示:
{
"query": {
"bool": {
"must": {
"match_all": {}
},
"filter": {
"bool": {
"must": [
{
"term": {
"name": "stanford designs"
}
}
]
}
}
}
}
}
希望这会起作用。
关于python - Elasticsearch过滤条件不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55863600/