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 jlefebvre <jl...@allocine.fr> on 2011/06/09 12:31:38 UTC

Boost or sort a query with range values

Hello

I try to boost a query with a range values but I can't find the correct
syntax :
this is ok .....&bq=myfield:"-1"^5 but I want to do something lik this
&bq=myfield:"-1 to 1"^5

Boost value from -1 to 1

thanks

--
View this message in context: http://lucene.472066.n3.nabble.com/Boost-or-sort-a-query-with-range-values-tp3043328p3043328.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Boost or sort a query with range values

Posted by Jan Høydahl <ja...@cominvent.com>.
Btw. your example is a simple boolean query, and this will also work:
&bq=(myfield1:0 AND myfield2:1)^100.0

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Solr Training - www.solrtraining.com

On 9. juni 2011, at 13.31, Jan Høydahl wrote:

> Check the new if() function in Trunk, SOLR-2136. You could then use it in &bf= or &boost=
> 
> --
> Jan Høydahl, search solution architect
> Cominvent AS - www.cominvent.com
> Solr Training - www.solrtraining.com
> 
> On 9. juni 2011, at 13.05, jlefebvre wrote:
> 
>> thanks it's ok
>> 
>> another question
>> how to do a condition in &bq ?
>> 
>> something like &bq=iif(myfield1 = 0 AND myfield2 = 1;1;0)
>> 
>> thanks
>> 
>> --
>> View this message in context: http://lucene.472066.n3.nabble.com/Boost-or-sort-a-query-with-range-values-tp3043328p3043406.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
> 


Re: Boost or sort a query with range values

Posted by Jan Høydahl <ja...@cominvent.com>.
Check the new if() function in Trunk, SOLR-2136. You could then use it in &bf= or &boost=

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Solr Training - www.solrtraining.com

On 9. juni 2011, at 13.05, jlefebvre wrote:

> thanks it's ok
> 
> another question
> how to do a condition in &bq ?
> 
> something like &bq=iif(myfield1 = 0 AND myfield2 = 1;1;0)
> 
> thanks
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Boost-or-sort-a-query-with-range-values-tp3043328p3043406.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Boost or sort a query with range values

Posted by jlefebvre <jl...@allocine.fr>.
thanks it's ok

another question
how to do a condition in &bq ?

something like &bq=iif(myfield1 = 0 AND myfield2 = 1;1;0)

thanks

--
View this message in context: http://lucene.472066.n3.nabble.com/Boost-or-sort-a-query-with-range-values-tp3043328p3043406.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Boost or sort a query with range values

Posted by lee carroll <le...@googlemail.com>.
[* TO *]^5

On 9 June 2011 11:31, jlefebvre <jl...@allocine.fr> wrote:
> Hello
>
> I try to boost a query with a range values but I can't find the correct
> syntax :
> this is ok .....&bq=myfield:"-1"^5 but I want to do something lik this
> &bq=myfield:"-1 to 1"^5
>
> Boost value from -1 to 1
>
> thanks
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Boost-or-sort-a-query-with-range-values-tp3043328p3043328.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>