Tengo el siguiente índice índice
{
"docs": {
"mappings": {
"text": {
"properties": {
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
"code": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
}
"código" puede tener los valores: ["a"], ["b"],["a","b"], o []
Necesito una consulta para aliviar los valores con el código: "un" o []. Alguien puede ayudar con esta consulta, aquí es lo que he intentado hasta ahora w/out éxito (esto parece decir "a" Y "[]"; quiero "un" O "[]").
"bool": {
"should": [
{
"match": {
"code": "a"
}
}
],
"must_not": [
{
"exists": {
"field": "code"
}
}
]
}