# Elasticsearch get top words of each document by custom function

**URL:** <https://discuss.elastic.co/t/elasticsearch-get-top-words-of-each-document-by-custom-function/20461>\
**Category:** Elasticsearch\
**Created:** [October 28, 2014, 12:45pm UTC](https://discuss.elastic.co/t/elasticsearch-get-top-words-of-each-document-by-custom-function/20461 "2014-10-28T12:45:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![valerij\_vasilcenko](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@valerij\_vasilcenko](https://discuss.elastic.co/u/valerij_vasilcenko)\
**Post date:** [October 28, 2014, 12:45pm UTC](https://discuss.elastic.co/t/elasticsearch-get-top-words-of-each-document-by-custom-function/20461/1 "2014-10-28T12:45:26Z")

</div>

I have a list of common words in English language

Each word has a rating

i need to get top 10 words of each document sorted by highest result of  
wordCount \* wordRatio

I think this should be done at indexing

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/33d0be41-db01-4581-8f58-852a78098413%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/33d0be41-db01-4581-8f58-852a78098413%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:53am UTC](https://discuss.elastic.co/t/elasticsearch-get-top-words-of-each-document-by-custom-function/20461/2 "2017-07-06T00:53:28Z")

</div>

Closed on July 6, 2017, 12:53am UTC


