Hi, I am trying to execute an aggregation to get the distinct"roles"
the field "roles" wich contain different roles separated with comma here an example:
"roles": ["\"ROLE_CUSTOMERGROUP,ROLE_PRONTO,western service\""]
the problem if i use a standard aggregation on the field roles, elasticsearch will split " western service " :
"aggregations": {
"roles": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "role_customergroup",
"doc_count": 3124
},
{
"key": "role_pronto",
"doc_count": 1945
},
{
"key": "role_rustic",
"doc_count": 1179
},
{
"key": "role_services",
"doc_count": 1179
},
{
"key": "services",
"doc_count": 1179
},
{
"key": "west",
"doc_count": 1179
}
]
}
is there any solotion to this problem? should i use a script?
Thank you !