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 CameronL <ca...@citysearch.com> on 2008/11/12 03:12:28 UTC

Re: Boost Query effect with Standard Request Handler

So the bq parameter works with the standard request handler (I don't have to
specify defType=dismax)??

I've been running a few tests and it doesn't seem to be picking up the bq. 
I've boosted one of the values very high (like 1000) compared to the other
fields and it doesn't seem to be affecting anything.

We're using Solr 1.3.  Is there something else I may be missing (some sort
of config)?
-- 
View this message in context: http://www.nabble.com/Boost-Query-effect-with-Standard-Request-Handler-tp20042301p20452647.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Boost Query effect with Standard Request Handler

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 18, 2009, at 10:54 AM, Vicky_Dev wrote:
> is there any way to boost fields in standard query parser itself?

You can boost terms using field:term^2.0 syntax

See http://wiki.apache.org/solr/SolrQuerySyntax and down into http://lucene.apache.org/java/2_4_0/queryparsersyntax.html 
  for more details.

	Erik


Re: Boost Query effect with Standard Request Handler

Posted by Vicky_Dev <vi...@yahoo.co.in>.
Hi Hossman,

We are also facing similar issue:

is there any way to boost fields in standard query parser itself?

~Vikrant




hossman wrote:
> 
> 
> : The reason I brought the question back up is that hossman said:
> 	...
> : I tried it and it didn't work, so I was curious if I was still doing
> : something wrong.
> 
> no ... i'm just a foolish foolish man who says things with a lot of 
> authority even though i clearly don't know what i'm talking about.
> 
> bq isn't supported directly by SearchHandler, and i need to learn to 
> double check the code before i answer questions about changes i wasn't 
> intimately involved with :)  ... sorry about that.
> 
> 
> -Hoss
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Boost-Query-effect-with-Standard-Request-Handler-tp20042301p24094722.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Boost Query effect with Standard Request Handler

Posted by Chris Hostetter <ho...@fucit.org>.
: The reason I brought the question back up is that hossman said:
	...
: I tried it and it didn't work, so I was curious if I was still doing
: something wrong.

no ... i'm just a foolish foolish man who says things with a lot of 
authority even though i clearly don't know what i'm talking about.

bq isn't supported directly by SearchHandler, and i need to learn to 
double check the code before i answer questions about changes i wasn't 
intimately involved with :)  ... sorry about that.


-Hoss


Re: Boost Query effect with Standard Request Handler

Posted by CameronL <ca...@citysearch.com>.
Ahh shoot!

Ok, I copied the original thread at the bottom for context.

Basically what I need is the bq functionality with the
StandardRequestHandler.  I can't use dismax because that requires using qf
and doesn't offer as much flexibility as we need.  I have used Erik's
technique of appending an additional clause to the end of all of my queries,
but this doesn't work when a document is missing the field that I'm boosting
on.  This is also an AND query, not OR:

name:something AND (searchTier:1^100 OR searchTier:2^50 ...OR
searchTier:0^1)

In the above example, I'd like to be able to leave the searchTier:0 off and
not have to index any documents that have no searchTier with value=0.  The
bq does this correctly, putting any documents that match the criteria but
without a searchTier at the bottom.


The reason I brought the question back up is that hossman said:

"as of SOlr 1.3 -- the "SearchHandler" (which superclasses and replaces the 
old StandardRequestHandler and the DisMaxRequestHandler) supports the "bq" 
param direclty ... so you can just add a bq param to your request and it 
will do what you want."

I tried it and it didn't work, so I was curious if I was still doing
something wrong.


Erik Hatcher wrote:
> 
> bq only works with dismax (&defType=dismax).  To get the same effect  
> with the lucene/solr query parser, append a clause to the original  
> query (OR'ing it in).
> 
> 	Erik
> 
> 
> On Nov 11, 2008, at 11:52 PM, Otis Gospodnetic wrote:
> 
>> Hi,
>>
>> It's hard to tell what you are replying to since you removed the  
>> original email (sounds like somebody suggested using bq).
>> I think it might help if you send the actual URL you are using.
>>
>>
>> Otis
>> --
>> Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
>>
>>
>>
>>
>> ________________________________
>> From: CameronL <ca...@citysearch.com>
>> To: solr-user@lucene.apache.org
>> Sent: Tuesday, November 11, 2008 9:12:28 PM
>> Subject: Re: Boost Query effect with Standard Request Handler
>>
>>
>> So the bq parameter works with the standard request handler (I don't  
>> have to
>> specify defType=dismax)??
>>
>> I've been running a few tests and it doesn't seem to be picking up  
>> the bq.
>> I've boosted one of the values very high (like 1000) compared to the  
>> other
>> fields and it doesn't seem to be affecting anything.
>>
>> We're using Solr 1.3.  Is there something else I may be missing  
>> (some sort
>> of config)?
>> -- 
>> View this message in context:
>> http://www.nabble.com/Boost-Query-effect-with-Standard-Request-Handler-tp20042301p20452647.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
> 
> 
> 



hossman wrote:
> 
> 
> : I'm trying to create the boost query (bq parameter) effect with the
> standard
> : request handler.  Unfortunately, going to the dismax handler isn't
> really an
> : option for me, so I'm trying to create a similar effect.
> 
> as of SOlr 1.3 -- the "SearchHandler" (which superclasses and replaces the 
> old StandardRequestHandler and the DisMaxRequestHandler) supports the "bq" 
> param direclty ... so you can just add a bq param to your request and it 
> will do what you want.
> 
> If you have to stick with 1.2 for some reason...
> 
> : I have an integer field, 'searchTier', that sort of needs to be factored
> : into every query. Something like:
> : 
> : q=name:something AND (searchTier:1^100 OR searchTier:2^50 OR
> : searchTier:3^25)
> : 
> : However, if a document has no tier, it should still turn up in the
> results,
> : just at the bottom.  Currently it does not.  I had been playing around
> with
> : this a couple months ago, and it worked as desired back then.  But after
> the
> : 1.3 release, the functionality seems to have changed.
> 
> in all versions of Solr that query would have required that searchTier 
> contain one of the values in the set (1,2,3) ... if you thought it was
> working before, trust me: something else was happening.
> 
> what you wante would have been something like...
> 
>    +name:something (searchTier:1^100 searchTier:2^50 searchTier:3^25)
> 
> ...note the "+" indicating that the name:something clause is required, and 
> no modifier in from the the parems indicating thta everything in there is 
> optional.
> 
> : I've tried several different ways to get around this:
> : q=name:something AND (searchTier:1^100 OR searchTier:2^50 OR
> searchTier:3^25
> : OR searchTier:[* TO *])
> 
> if you *must* use the AND/OR keywords, the only way to do something like 
> this would be...
> 
>    name:something AND (*:* OR searchTier:1^100 OR searchTier:2^50 ...)
> 
> 
> 
> -Hoss
> 
> 
> 


-- 
View this message in context: http://www.nabble.com/Boost-Query-effect-with-Standard-Request-Handler-tp20042301p20464737.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Boost Query effect with Standard Request Handler

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
bq only works with dismax (&defType=dismax).  To get the same effect  
with the lucene/solr query parser, append a clause to the original  
query (OR'ing it in).

	Erik


On Nov 11, 2008, at 11:52 PM, Otis Gospodnetic wrote:

> Hi,
>
> It's hard to tell what you are replying to since you removed the  
> original email (sounds like somebody suggested using bq).
> I think it might help if you send the actual URL you are using.
>
>
> Otis
> --
> Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
>
>
>
>
> ________________________________
> From: CameronL <ca...@citysearch.com>
> To: solr-user@lucene.apache.org
> Sent: Tuesday, November 11, 2008 9:12:28 PM
> Subject: Re: Boost Query effect with Standard Request Handler
>
>
> So the bq parameter works with the standard request handler (I don't  
> have to
> specify defType=dismax)??
>
> I've been running a few tests and it doesn't seem to be picking up  
> the bq.
> I've boosted one of the values very high (like 1000) compared to the  
> other
> fields and it doesn't seem to be affecting anything.
>
> We're using Solr 1.3.  Is there something else I may be missing  
> (some sort
> of config)?
> -- 
> View this message in context: http://www.nabble.com/Boost-Query-effect-with-Standard-Request-Handler-tp20042301p20452647.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Boost Query effect with Standard Request Handler

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Hi,

It's hard to tell what you are replying to since you removed the original email (sounds like somebody suggested using bq).
I think it might help if you send the actual URL you are using.


Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch




________________________________
From: CameronL <ca...@citysearch.com>
To: solr-user@lucene.apache.org
Sent: Tuesday, November 11, 2008 9:12:28 PM
Subject: Re: Boost Query effect with Standard Request Handler


So the bq parameter works with the standard request handler (I don't have to
specify defType=dismax)??

I've been running a few tests and it doesn't seem to be picking up the bq. 
I've boosted one of the values very high (like 1000) compared to the other
fields and it doesn't seem to be affecting anything.

We're using Solr 1.3.  Is there something else I may be missing (some sort
of config)?
-- 
View this message in context: http://www.nabble.com/Boost-Query-effect-with-Standard-Request-Handler-tp20042301p20452647.html
Sent from the Solr - User mailing list archive at Nabble.com.