Sorting by number of hits

I'm fairly new to Elastic Search and am wondering if it's possible to sort the results by the number of hits each document has. Essentially, if i'm searching a string for the word "test" I need sort the results by the documents that have the string with the word "test" occuring the most. So far, this doesn't seem possible. Does anyone know how this can be done?


Well the computed score is supposed to do that.
By default elasticsearch sorts on score.

So all defaults should be good I think.

The computed score doesn't sort the way i need it. Probably didn't describe it well enough.

We have indexed large word documents into elastic search and have queries that search for words, phrases and wildcards in these word documents. We also use the highlighting feature to display the snippet of where these matches appear. What i need is to sort the results by the number of highlights for each word document. Is that possible?

I don't believe so.

Ok. Thanks!

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