【发布时间】:2014-12-04 21:33:46
【问题描述】:
我正在从 elasticsearch 索引中获取数据。 我想过滤掉某些列中包含 null 或空字符串值的文档。 然而,当我使用“缺失”或“存在”方法时,我遇到了 values = "" 的一些问题,因为它们没有被过滤掉并显示在结果中
我曾想过使用通配符,但在处理 ID 中有多个单词的列时它没有给出任何结果(例如:警报描述、警报 ID 等)
使用 elasticsearch-1.3.2
我的代码缺失/存在:
{
"query" : {
"constant_score" : {
"filter" : {
"exists" : {
"field" : "myfield"
}
}
}
}
}
我的通配符代码:
{
query: {
bool: {
must: [
{
constant_score: {
filter: {
missing: {
field: trap_message.enterprise
}
}
}
}
]
must_not: [ ]
should: [ ]
}
}
from: 0
size: 10
sort: [ ]
facets: { }
}
【问题讨论】:
标签: elasticsearch null wildcard