Hello,
I am using 7.16.3 Elasticsearch and I am trying to perform a transform aggregation on an index to create a summary index (basically have the same index but with an aggregated timestamp by day to be smaller).
Among the fields I am aggregating, there is a multifield that has this mapping :
"features" : {
"fielddata" : true,
"analyzer" : "feature_analyzer",
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword"
}
}
}
and this analyzer :
"analysis" : {
"analyzer" : {
"feature_analyzer" : {
"filter" : [
"uppercase"
],
"tokenizer" : "tilde_tokenizer"
}
},
"tokenizer" : {
"tilde_tokenizer" : {
"pattern" : """\~""",
"type" : "simple_pattern_split"
}
}
}
For example, if the source is value1~value2, a terms aggregation on features will give two results (value 1 and value 2), and a terms aggregation on features.keyword will output only one (value1~value2).
I need in my transformed index to have the same field with the same content (so the same features value and the same features.keyword value)
The problem is that when I try a terms aggregation using features.keyword, I lose some information as the aggregation is not a text anymore, and I have as a result the non-analyze field.
A terms aggregation on features does not work either : I have null fields.
What can I do to get the expected results?