On 9/30/2019 9:06 AM, yuri.glad...@swisscom.com wrote:
Is it possible to turn off the weighted search for Solr?
I mean the results have to be presented in a pure alphabetical order, not by 
the default weighted order. So if a certain letter appears in a word 2 times, 
this word shouldn' t be ranked higher.
I spent the whole day trying to find the solution in the internet, tried various options with EdgeNGramFilterFactory, 
but it still doesn't work (the results starting with "a" have to come up first and the results starting with 
"z" come up last, currently I have "taa" as a first result, just because the letter "a" 
appears there two times).

Supply a sort parameter telling Solr how you want the results sorted. The default sort value is "score desc" which means that it will be sorted on the query score, largest values first. Which is the standard relevancy sort.

In your case, you would pick one of your fields to sort on and send the following parameter, replacing XX with the correct field name:

sort=XX asc

You could also use "desc" instead of "asc" if you want a reverse alphabetical sort instead.

https://lucene.apache.org/solr/guide/8_1/common-query-parameters.html#sort-parameter

Note that if you try to sort on a tokenized field or a multivalued field, you're probably not going to get the results you want.

Thanks,
Shawn

Reply via email to