Hi, I am trying to group distinc products:
Post localhost:9200/logstash-2016.04.18/_search
{
"aggs": {
"DistincProduct": {
"terms": {
"field": "productcode"
}
}
}
}
and this is the result:
{
"error": {
"root_cause": [
{
"type": "illegal_state_exception",
"reason": "Field data loading is forbidden on [productcode]"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "logstash-2016.04.18",
"node": "VPzQxOtkRk6oF3r6rOA3yg",
"reason": {
"type": "illegal_state_exception",
"reason": "Field data loading is forbidden on [productcode]"
}
}
]
},
"status": 500
}
And this is the corresponding mapping for the ProductCode field:
"productcode": {
"type": "string",
"norms": {
"enabled": false
},
"fielddata": {
"format": "disabled"
},
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed",
"ignore_above": 256
}
}
}
Thank you in advence, i really need an answer .