Question

I have a full text search engine built on elastic search. I need to find the top phrases in the engine. This would typically be named entities in the text indexed. How can this be done?

Was it helpful?

Solution

I would facet against a field to discover the most common text, phrases or words (depending on your index settings) are that appear within Elasticsearch' Inverted Index.

Sample Facet

{
  "size": 0,
  "query": {
    "match_all": {}
  },
  "facets": {
    "tag": {
      "terms": {
        "field": "firstname",
        "size": 6
      }
    }
  }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top