【发布时间】:2014-03-01 06:04:45
【问题描述】:
我无法过滤我的 elasticsearch 查询来查找值为“no”的项目。我使用的是 0.90 版。
使用以下项目创建索引:
{ "foo": "abc", "bar": "yes" }
{ "foo": "def", "bar": "no" }
{ "foo": "ghi", "bar": "maybe" }
现在,在bar 上尝试一些术语查询:
{ "query": { "term": { "bar": "yes" } } }
// Hits: 1
{ "query": { "term": { "bar": "maybe" } } }
// Hits: 1
{ "query": { "term": { "bar": "no" } } }
// Hits: 0 <-- What??
当我使用“no”值查询时没有命中。
看方面:
{ "facets": { "bar": { "terms": { "field": "bar" } } } }
结果:
{
...
"facets": {
"bar": {
"_type": "terms",
"missing": 1,
"total": 2,
"other": 0,
"terms": [
{ "term": "yes", "count": 1 },
{ "term": "maybe", "count": 1 }
]
}
}
}
甚至没有为“no”值返回一个方面。到底是怎么回事?如何在我的索引中找到值为“no”的项目?
我刚刚下载了最新版本 (1.0.1),我可以看到这已修复。但是,我在 0.90.3 并且行为在 0.90.12 中是相同的。有没有办法让它在 0.90.* 中工作?
【问题讨论】:
标签: elasticsearch