lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Haruska <jharu...@gmail.com>
Subject Re: Negative boosting?
Date Thu, 28 Oct 2004 17:23:07 GMT
Hi Terry,

I know this is an old message on the list but it does not look like
anyone responded to your request. I had to do negative boosting for my
search functionality as well so I'd like to share the modification to
QueryParser.jj to make it work. Find your <Boost> TOKEN and change it
to:

<Boost> TOKEN : {
<NUMBER:    (["-"])? (<_NUM_CHAR>)+ ( "." (<_NUM_CHAR>)+ )? > : DEFAULT
}


This simply allows an optional negative sign in front of a boost
value. After stepping through the program I've seen the
negative value carry through to the weight calculation.

Hope this helps.

------- Start Quote --------
I've often found the use of query-based boosting to be very
beneficial.  This is particularly so when it's easy to identify the
term that I want to stand out as a primary selector.

However, I've come across quite a few other cases where it would be
easier (and more logical) to apply a negative boost - to de-emphasize
the match when the term is present.

Is it possible to apply a negative boost (It doesn't seem to work),
and if not, would it break anything significant [sic] if that were added?

Regards,

Terry

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message