ElasticSearch version: 6.6
Language: PHP
Hello and good day! I'm using Laravel PHP Framework and ElasticSearch as our database / search engine.
In my Index, I'm trying to get a list of Authors who had produced the most Articles, here's my parameters:
$params = [
'index' => 'mmi.webs',
'type' => '_doc',
"from" => '0', //default 0
"size" => '10', //default 10
'body' => [
'aggs' => [
'authors' => [
'terms' => [
'field' => 'author_id',
'size' => 25,
'order' => [ '_term' => 'asc' ]
]
],
]
]
];
But unfortunately it returns this error according to my author_id, ""Fielddata is disabled on text fields by default. Set fielddata=true".
I've searched for different solutions, and some said turn on the "keyword" something, but according to the mapping of my index, keywords are already enabled
"author_id" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
So why is it still not working?