What you indicated here is for a different purpose, is it not? I already do
something similar with my 'q'. For example a sample query logged in
'catalina.out' looks like

webapp=/search path=/select
params={rows=15&start=0&q=(+(content:umts)+OR+(title:umts)^2+OR+(urltext:umts)^2)}

when the search term is "umts". I am looking for this term "umts" in the
fields  - (a) content, (b) title (boosted by a factor of 2) and (c) urltext
(boosted by a factor of 2). So the presense of the term "umts" in title or
url is weighed more than its presense in the regular content. So far so
good.

Now, I have other fields as well, like document type, file type etc... that
serve as facets to telescope down. Among the above set of search results, I
want to boost a specific document type 'white_papers' & a specific file type
"pdf". By boosting I mean that these white_paper & pdf documents should
float to the top of the heap in the search results, if such documents are at
all present in the search results.

So would I simply add the following to the above "q"?

q=(+(content:umts)+OR+(title:umts)^2+OR+(urltext:umts)^2)+AND+(doctype:white_papers)^2+AND+(filetype:pdf)^2

But wouldn't the above give 0 results if there are no white_papers & pdfs
(because of the AND)? If I use OR, then the meaning of the query is lost
altogether.

What we need is for the white_papers & pdfs to be boosted, but if and only
if such doucments are valid results to the search term in question. How
would I write my above 'q' to accomplish that?

Thanks

- ashok



Shalin Shekhar Mangar wrote:
> 
> On Fri, Apr 17, 2009 at 1:03 AM, ashokc <ash...@qualcomm.com> wrote:
> 
>>
>> I have a query that yields results binned in several facets. How can I
>> boost
>> the results that fall in certain facets over the rest of them that do not
>> belong to those facets? I use the standard query format. Thank you
> 
> 
> I'm not sure what you mean by boosting by facet. Do you mean that you want
> to boost documents which match a term query?
> 
> If yes, you can use your_field_name:value^2.0 in the q parameter.
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Boosting-by-facets-with-standard-query-tp23084860p23091586.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to