lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Schneider <>
Subject multiple Tokens in a Tokengroup not matching
Date Fri, 14 Sep 2007 13:59:49 GMT

I've inherited some Lucene 1.9.1 code, and have run into the following 

I have a TokenGroup with multiple tokens in it, and a query that should 
match against multiple tokens (e.g. X and Y) in the TokenGroup.  
However, when I look in the Hit that results, I see that one of the 
Tokens in the TokenGroup has a weight of 1.0, while all the rest have a 
weight of 0.  If I run a search with just X in the query, it matches the 
TokenGroup, and when I run a search with just Y in the query, it also 
matches the TokenGroup, just as I'd expect.  But a query that includes 
both X and Y looks like only X matches.  I need to see that both X and Y 
matched in order to get my highlighting to work correctly.

Can anyone provide any hints as to what might be going on here, and what 
I might do to fix it?  We have a vague suspicion that it's related to 
the weight on the matching token being 1.0 that's causing Lucene to not 
both with any other tokens (because the weight for the TokenGroup is 
already as high as it can be), but it's just a suspicion.


Dave Schneider

View raw message