Elasticsearch:为什么我的查询返回太多结果? [英] Elasticsearch: Why is my query returning too many results?
问题描述
我使用以下查询查询 http://elasticsearch.myserver.net:9200/my_index/foo/
:
{
查询:{
ids:{
type:foo,
值:[
fff,
bar,
baz
]
}
}
}
但是,我收到了12个匹配的回复,这是我的foo类型的总数索引,而不是三个,这是我要求的数字。我通过在弹性搜索头的任何请求选项卡中键入此查询。发生了什么?
更新:
我也尝试过
{
pre>
查询:{
bool:{
必须:[
{
ids:{
type:program,
values:[
fff,
330930,
200005
]
}
}
]
}
}
}
具有相同的结果。
解决方案请求标签头,确保您的下拉式请求方法设置为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屋!