You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Denis Kuzmenok <fo...@ukr.net> on 2011/06/09 14:48:07 UTC

Edismax sorting help

Hi, everyone.

I have fields:
text fields: name, title, text
boolean field: isflag (true / false)
int field: popularity (0 to 99999)

Now i do query:
defType=edismax
start=0
rows=20
fl=id,name
q=lg optimus
fq=
qf=name^3 title text^0.3
sort=score desc
pf=name
bf=isflag sqrt(popularity)
mm=100%
debugQuery=on


If i do query like "Samsung" i want to see prior most relevant results
with  isflag:true and bigger popularity, but if i do query like "Nokia
6500"  and  there is isflag:false, then it should be higher because of
exact  match.  Tried different combinations, but didn't found one that
suites   me.   Just   got   isflag/popularity   sorting   working   or
isflag/relevancy sorting.


Re: Edismax sorting help

Posted by Denis Kuzmenok <fo...@ukr.net>.
Your  solution  seems  to work fine, not perfect, but much better then
mine :)
Thanks!

>> If i do query like "Samsung" i want to see prior most relevant results
>> with  isflag:true and bigger popularity, but if i do query like "Nokia
>> 6500"  and  there is isflag:false, then it should be higher because of
>> exact  match.  Tried different combinations, but didn't found one that
>> suites   me.   Just   got   isflag/popularity   sorting   working   or
>> isflag/relevancy sorting.

> Multiplicative boosts tend to be more stable...

> Perhaps try replacing
>   bf=isflag sqrt(popularity)
> with
>   bq=isflag:true^10          // vary the boost to change how much
> isflag counts vs the relevancy score of the main query
>   boost=sqrt(popularity)  // this will multiply the result by
> sqrt(popularity)... assumes that every document has a non-zero
> popularity

> You could get more creative in trunk where booleans have better
> support in function queries.

> -Yonik
> http://www.lucidimagination.com





Re: Edismax sorting help

Posted by Yonik Seeley <yo...@lucidimagination.com>.
2011/6/9 Denis Kuzmenok <fo...@ukr.net>:
> Hi, everyone.
>
> I have fields:
> text fields: name, title, text
> boolean field: isflag (true / false)
> int field: popularity (0 to 99999)
>
> Now i do query:
> defType=edismax
> start=0
> rows=20
> fl=id,name
> q=lg optimus
> fq=
> qf=name^3 title text^0.3
> sort=score desc
> pf=name
> bf=isflag sqrt(popularity)
> mm=100%
> debugQuery=on
>
>
> If i do query like "Samsung" i want to see prior most relevant results
> with  isflag:true and bigger popularity, but if i do query like "Nokia
> 6500"  and  there is isflag:false, then it should be higher because of
> exact  match.  Tried different combinations, but didn't found one that
> suites   me.   Just   got   isflag/popularity   sorting   working   or
> isflag/relevancy sorting.

Multiplicative boosts tend to be more stable...

Perhaps try replacing
  bf=isflag sqrt(popularity)
with
  bq=isflag:true^10          // vary the boost to change how much
isflag counts vs the relevancy score of the main query
  boost=sqrt(popularity)  // this will multiply the result by
sqrt(popularity)... assumes that every document has a non-zero
popularity

You could get more creative in trunk where booleans have better
support in function queries.

-Yonik
http://www.lucidimagination.com