【发布时间】:2018-05-17 07:18:27
【问题描述】:
我正在尝试在 Elastic Search 中使用查询,其中忽略了所有 English("taal":"engels") 书籍。 我想我应该使用 bool 查询和 must_not,条件是查询中的“taal”:“Engels”。
GET books/_search
{
"query": {
"bool": {
"must_not" : {
"term" : { "taal" : "Engels" }
}
}
}
}
但是,在 Kibana 中运行此查询时,它仍会显示语言 = 英语的结果。
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 501,
"max_score": 1,
"hits": [
{
"_index": "producten4",
"_type": "boek",
"_id": "9780582401815",
"_score": 1,
"_source": {
"isbn": "9780582401815",
"hoofdtitel": "Forrest Gump",
"taal": "Engels",
}
},
ETCETERA....
]
}
}
字段 taal 的映射:
"taal": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
},
"raw": {
"type": "keyword"
},
"taal": {
"type": "text"
}
}
}
【问题讨论】:
标签: elasticsearch boolean kibana