lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Sorting results by Range
Date Thu, 01 Sep 2011 23:12:07 GMT

: sort=map(map(myNumField,0,10,0),20,100,0) desc, score desc
: sort=map(map(myNumField,0,10,100),20,100,100) asc, score desc
	...
: By doing the second one, I expected to get the same results, ordered like
: 13, 17,18, 20. But, what I got were other values as results, that are not in
: the chosen range: 9, 8,7, 5 etc.
: 
: My question previously was: How to get results with "myNumFields" values
: between 10 and 20 ranked above the rest, in the ascending order.

Hmmm.... w/o more info i'm not sure that i can explain the behavior you 
are seeing.

Using the 3x branch, with the 17 example docs indexed, i just tried these 
queries...

http://localhost:8983/solr/select?q=*:*+video+solr&fl=score,popularity&rows=100&sort=score+desc

...returns all 17 docs, ordered by score descending, and shows that all 
the popularity values are between 0 and 10.

http://localhost:8983/solr/select?q=*:*+video+solr&fl=score,popularity&rows=100&sort=map%28map%28popularity,0,5,0%29,8,10,0%29+desc,+score+desc

...reorders the docs so everything with a popularity value above 5 and 
less then 8 is listed first, descending (ie: pop sevens then pop sixes), 
followed by all other docs in order of score descending (regardless of the 
popularity value) 

http://localhost:8983/solr/select?q=*:*+video+solr&fl=score,popularity&rows=100&sort=map%28map%28popularity,0,5,100%29,8,10,100%29+asc,+score+desc

...reorders the docs so everything with a popularity value above 5 and 
less then 8 is listed first, ascending (ie: pop sixes then pop sevents), 
followed by all other docs in order of score descending (regardless of the 
popularity value) 

perhaps you could post your configs and some sample data in an easy to 
consume format (csv?) demonstrating the problem you are seeing?

-Hoss

Mime
View raw message