lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <yo...@lucidimagination.com>
Subject Re: Trying to avoid filtering on score, as I'm told that's bad
Date Wed, 27 Jun 2012 23:47:55 GMT
On Wed, Jun 27, 2012 at 6:50 PM, mcb <thestreets21@gmail.com> wrote:
> I have a function query that returns miles as a score along two points:
>
> q={!func}sub(sum(geodist(OriginCoordinates,39,-105),geodist(DestinationCoordinates,36,-97),Mileage),1000)
>
> The issue that I'm having now now my results give me a list of scores:
> *score:10.1 (mi)
> score: 20 (mi)
> score: 75 (mi)
> *
> But I would like to also add a clause that cuts off the results after X
> miles (say 50) so that 75 above would not be included in the results.
> Unfortunately I can't say fq=score:[0 TO 50], but perhaps there is another
> way? I'm on solr 4.0

If you want to cut off the whole function at 75, then frange can do that:
q={!frange u=75}sub(sum(...

http://lucene.apache.org/solr/api/org/apache/solr/search/FunctionRangeQParserPlugin.html

-Yonik
http://lucidimagination.com

Mime
View raw message