|
|
-
Boost a document score via query using MoreLikeThisHandler
Christopher Bottaro 2010-03-02, 01:36
Hello,
Is it possible to boost a document's score based on something like fq=site(com.google*). In other words, I want to boost the score of documents who's "site" field starts with "com.google".
I'm using the MoreLikeThisHandler.
Thanks for the help, -- Christopher
-
Re: Boost a document score via query using MoreLikeThisHandler
Christopher Bottaro 2010-03-02, 03:35
On Mon, Mar 1, 2010 at 7:36 PM, Christopher Bottaro <[EMAIL PROTECTED]> wrote: > Hello, > > Is it possible to boost a document's score based on something like > fq=site(com.google*). In other words, I want to boost the score of > documents who's "site" field starts with "com.google". > > I'm using the MoreLikeThisHandler. > > Thanks for the help, > -- Christopher >
Ok, I think I need to do this with BoostQParserPlugin and nested queries, but I can't quite figure it out.
So this works... q={!boost b=log(popularity)}(title:barack OR title:obama)
But instead of boosting by popularity, I want to boost by site: q={!boost b=query({ !query q='site:*.yahoo.com' })}(title:barack OR title:obama)
This is the exception I get... org.apache.lucene.queryParser.ParseException: Expected identifier at pos 18 str='{!boost b=query({ !query q='site:*.yahoo.com' })}(title:barack OR title:obama)'
But that doesn't work. Any tips? Thanks.
-
Re: Boost a document score via query using MoreLikeThisHandler
Lance Norskog 2010-03-02, 06:35
If I remove the space before !query, this is the error: Cannot parse ')}': Encountered " ")" ") "" at line 1, column 0.
Perhaps someone knows how parentheses and curlies combine here?
Also: *.yahoo.com will not work. Wildcards do not work at the beginning of a word. To make this search work, you should reverse the order of the site name parts: 'com.yahoo.wahoo'.
On Mon, Mar 1, 2010 at 7:35 PM, Christopher Bottaro <[EMAIL PROTECTED]> wrote: > On Mon, Mar 1, 2010 at 7:36 PM, Christopher Bottaro > <[EMAIL PROTECTED]> wrote: >> Hello, >> >> Is it possible to boost a document's score based on something like >> fq=site(com.google*). In other words, I want to boost the score of >> documents who's "site" field starts with "com.google". >> >> I'm using the MoreLikeThisHandler. >> >> Thanks for the help, >> -- Christopher >> > > Ok, I think I need to do this with BoostQParserPlugin and nested > queries, but I can't quite figure it out. > > So this works... > q={!boost b=log(popularity)}(title:barack OR title:obama) > > But instead of boosting by popularity, I want to boost by site: > q={!boost b=query({ !query q='site:*.yahoo.com' })}(title:barack OR title:obama) > > This is the exception I get... > org.apache.lucene.queryParser.ParseException: Expected identifier at > pos 18 str='{!boost b=query({ !query q='site:*.yahoo.com' > })}(title:barack OR title:obama)' > > But that doesn't work. Any tips? Thanks. >
-- Lance Norskog [EMAIL PROTECTED]
-
Re: Boost a document score via query using MoreLikeThisHandler
Chris Hostetter 2010-03-04, 21:57
: Ok, I think I need to do this with BoostQParserPlugin and nested : queries, but I can't quite figure it out.
you can't actually nest parsers like this ... but you can use the "$foo" sintax to seperate them out into alternate params...
/solr/select/?yourChoice={!query}name:solr&q={!boost+b=$yourChoice}(cat:software+OR+cat:camera)
-Hoss
|
|