Visualization doesn't allow "terms" aggreagation


(David Gabay) #1

I'm trying to produce a tag cloud for a textual field.

I uploaded the data to ES from CSV, then edited the index mapping and created a new index, with "fielddata = true" for the textual fields on which I want to aggregate.

The mapping of the textual fields is as follows:
//
PUT demo_0_5_new
{
"settings" : {
"number_of_shards" : 1
},
"mappings": {
"doc": {
...
"text": {
"type": "text",
"fielddata": true
},
"text_no_stopwords": {
"type": "text",
"fielddata": true
}
...
//

With this index, I can perform "terms" aggregation from Kibana's dev-tools tab, using the command:

GET demo_0_5_new/_search
{
"aggs" : {
"text" : {
"terms" : { "field" : "text" ,
"size": 100
}
}
}
}

This query runs successfully and return the 100 most frequent words.

However, in the "index pattern" tab, the "text" fields is not shown as "aggregateble" , and in the visualize tab, it cannot be selected for the "terms" aggregation.

If the field is not aggregatable, how can is it that I can run a "terms" query via the dev-tools tab? What do I need to do to get a tag-cloud visualization (which requires terms agg) for this fields?


(Erik W) #2

Try:
PUT demo_0_5_new
{
"settings" : {
"number_of_shards" : 1
},
"mappings": {
"doc": {
...
"text": {
"type": "keyword",
"fielddata": true
},
"text_no_stopwords": {
"type": "text",
"fielddata": true
}


(system) #3

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