I parse a file with filebeat and send it to elasticsearch where I parse it with an ingest node into fields. The problem I have is that I want to use term
queries to match the text of one of those fields.
Until 2 days ago, I could use:
"term": {
"name.of.field.keyword": {
"value": "exact_value_here"
}
}
and I would get back the results.
But now, the above query leaves out some newer documents. If I remove .keyword
from the query, I get the newer documents but I miss all the old ones.
The mapping in the index was created as:
"event": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
but in newer indexes it is created as:
"event": {
"type": "keyword",
"ignore_above": 1024
},
My questions:
- What is the best way to match exactly the content of a string field?
- How come the same field changed mapping? The same version of both filebeat and elasticsearch was used. How can I make sure that all these filebeat fields are of type
keyword
and nottext
?