Turn off weighted search

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Turn off weighted search

Yuri.Gladkov
Hello
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).
Thanks in advance
Yuri Gladkov

Reply | Threaded
Open this post in threaded view
|

Re: Turn off weighted search

Shawn Heisey-2
On 9/30/2019 9:06 AM, [hidden email] 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 | Threaded
Open this post in threaded view
|

Re: Turn off weighted search

Alexandre Rafalovitch
In reply to this post by Yuri.Gladkov
Can you give a more detailed example, please? Including the schema bits.

There is a bunch of assumptions in here that are hard to really make
sense of. Solr works with tokens, but you are talking about letter
repetitions. Also, if you want to sort by the string, why not just use
sort parameter? It is not clear why your use case is harder than that

There is also a way to mark the field to not use frequency or length
information (omitNorms, omitTermFreqAndPositions) but I hesitate to
suggest those as you are talking about letters.

Regards,
   Alex.

On Mon, 30 Sep 2019 at 13:31, <[hidden email]> wrote:
>
> Hello
> 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).
> Thanks in advance
> Yuri Gladkov
>