Is there any ways to get Popular keywords?


(Lael Moon) #1

Hello.
I want to implement today's hot keyword.

== Here is my mapping data ==

{
          "content": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "date_format": {
            "type": "date",
            "format": "yyyy/MM/dd HH:mm:ss||yyyy/MM/dd||epoch_millis"
          },
          "title": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          }

====

I tried query like below.

{
    "aggs" : {
        "popular_keywords" : {
            "terms" : { "field" : "content",

            }
        }
    }
}

And i got error message.

"Fielddata is disabled on text fields by default. Set fielddata=true on [content] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."

I have no idea what to do next.
Please help!


(Lael Moon) #2

Problem solved with fielddata=true.


(system) #3

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