Elasticsearch:为什么我的查询返回太多结果? [英] Elasticsearch: Why is my query returning too many results?

查看:815
本文介绍了Elasticsearch:为什么我的查询返回太多结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下查询查询 http://elasticsearch.myserver.net:9200/my_index/foo/

  {
查询:{
ids:{
type:foo,
值:[
fff,
bar,
baz
]
}
}
}

但是,我收到了12个匹配的回复,这是我的foo类型的总数索引,而不是三个,这是我要求的数字。我通过在弹性搜索头的任何请求选项卡中键入此查询。发生了什么?



更新:



我也尝试过

  {
查询:{
bool:{
必须:[
{
ids:{
type:program,
values:[
fff,
330930,
200005
]
}
}
]
}
}
}
pre>

具有相同的结果。

解决方案

请求标签头,确保您的下拉式请求方法设置为POST。如果您选择了GET方法,则可能会返回与您所看到的结果相似的所有结果。




I'm querying http://elasticsearch.myserver.net:9200/my_index/foo/ with the following query:

{
"query": {
    "ids": {
      "type": "foo",
      "values": [
        "fff",
        "bar",
        "baz"
      ]
    }
  }
}

But I'm getting a response with 12 hits, which is the total number of items of type foo in my index, rather than three, which is the number I requested. I'm making this query by typing it into the "any request" tab of elasticsearch head. What is going on?

Update:

I've also tried

{
  "query": {
    "bool": {
      "must": [
        {
          "ids": {
            "type": "programme",
            "values": [
              "fff",
              "330930",
              "200005"
            ]
          }
        }
      ]
    }
  }
}

with the same result.

解决方案

If using the Any Request tab in head, make sure you have the dropdown request method set to "POST". If you have the "GET" method selected it may return all results similar to what you are seeing.

这篇关于Elasticsearch:为什么我的查询返回太多结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆