I currently have something like:
"aggs": {
"group_by_myfield": {
"terms": {
"field": "myfield"
}
}
}
However, the value for myfield is alpha 1.0, alpha 2.0, beta 1.0. Now I want to aggregate only by the values of "alpha", "beta". How should I do it? I have tried:
"aggs": {
"group_by_myfield": {
"terms": {
"field": "myfield"
"script": "_value.split()[0]"
}
}
}
But I think there is no shared functionality. Any suggestions are welcome!
I found a similar question here , which also remains unanswered.
source
share