我有以下索引
{
"docs": {
"mappings": {
"text": {
"properties": {
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
"code": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
}
"代码"可具有的价值观:["a"],["b"],["a"、"b"]或[]
我需要查询,以减轻价值观码:"一个"或[]. 任何人都可以帮助这一查询,这里是我已经试过这么远w/出的成功(这似乎说"a"和"[]";我想"一个"或"[]").
"bool": {
"should": [
{
"match": {
"code": "a"
}
}
],
"must_not": [
{
"exists": {
"field": "code"
}
}
]
}