You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by bu...@apache.org on 2001/10/24 20:45:12 UTC

DO NOT REPLY [Bug 4254] - QueryParser does not recognized negative numbers...

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4254>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4254

QueryParser does not recognized negative numbers...





------- Additional Comments From cutting@apache.org  2001-10-24 11:45 -------
The way boosts are currently implemented, I actually don't think that this will 
work.  The boosts are squared in TermQuery.sumOfSquaredWeights(), which loses 
their negativeness, no?

And as you've reported separately, zeroed weights don't do what you want either.

Can you try changing that method so that boosts are not multiplied in until 
after the query is normalized?  Tell me if that makes things work any better 
for you.
   
   final float sumOfSquaredWeights(Searcher searcher) throws IOException {
-    idf = Similarity.idf(term, searcher);
-    weight = idf * boost;
+    weight = idf = Similarity.idf(term, searcher);
     return weight * weight;			  // square term weights
   }
 
   final void normalize(float norm) {
     weight *= norm;				  // normalize for query
     weight *= idf;				  // factor from document
+    weight *= boost;                              // boost query
   }