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 Kevin Osborn <os...@yahoo.com> on 2008/12/13 01:30:18 UTC

negative boosts

My index has a category field and I would like to apply a negative boost to certain categories. For example, if I search for "thinkpad", it should push results for the laptop bag and other accessory categories to the bottom.

So, I first tried altering the bq field with category:(batteries bags cables)^0.3.

In fact, this seems to positively boost products in those categories. This actually makes sense because the parsedQuery is something like:

+DisjunctionMaxQuery((category:thinkpad^1.75 | description:thinkpad^1.3 | manufacturer:thinkpad^1.6)~1.1) DisjunctionMaxQuery((category:thinkpad^1.75 | description:thinkpad^1.3 | manufacturer:thinkpad^1.6)~1.1) ((category:batteries category:bags category:cables)^0.3)

So, since only the negatively boosted categories are in the query, those categories make their way to the top when they are matched.

Is the only way to make this work to postively boost certain categories?



      

Re: negative boosts

Posted by Chris Hostetter <ho...@fucit.org>.
: My index has a category field and I would like to apply a negative boost 
: to certain categories. For example, if I search for "thinkpad", it 
: should push results for the laptop bag and other accessory categories to 
: the bottom.

: So, I first tried altering the bq field with category:(batteries bags cables)^0.3.
	...
: Is the only way to make this work to postively boost certain categories?

Bingo.  you need to boost all products *not* in those categories...

	bq = *:* -category:(batteries bags cables)


-Hoss