Sorting by number of hits


(alopez) #1

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?

Thanks


(David Pilato) #2

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

So all defaults should be good I think.


(alopez) #3

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?


(David Pilato) #4

I don't believe so.


(alopez) #5

Ok. Thanks!


(system) #6

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