Elasticsearch bucket aggregation

Would anybody suggest to get aggregation response as below, bucket aggregation values should be word wise rather than phrase.

Ex dataset on which aggregation query is being run:

{"skill": "3+ years of experience on java"}
{"skill": "3+ years of experience on java"}
{"skill": "java"}

Current response:
{
"took": 10,
"timed_out": false,
"_shards": {
"total": 3,
"successful": 3,
"failed": 0
},
"hits": {
"total": 6098,
"max_score": 0,
"hits": []
},
"aggregations": {
"aggs": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "3+ years of experience on java",
"doc_count": 2
},
{
"key": "java",
"doc_count": 1
}
]
}
}
}

Expecting response :

{
"took": 10,
"timed_out": false,
"_shards": {
"total": 3,
"successful": 3,
"failed": 0
},
"hits": {
"total": 6098,
"max_score": 0,
"hits": []
},
"aggregations": {
"aggs": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "java",
"doc_count": 3
}
]
}
}
}

"skill" needs to be an analyzed field for this to work at the word level.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.