lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Sokolov <>
Subject filter by term frequency
Date Sat, 16 Jun 2012 18:33:51 GMT
I imagine this is a question that comes up from time to time, but I 
haven't been able to find a definitive answer anywhere, so...

I'm wondering whether there is some type of Lucene query that filters by 
term frequency.   For example, suppose I want to find all documents that 
have exactly 2 occurrences of some word.  I know that the frequency is 
stored and used in scoring , but I don't think it is exposed in a simple 
way at the query level.  It looks to me as if CustomScoreQuery might be 
a convenient way to monkey with scores?  But it doesn't seem to use that 
for filtering, just sorting.  Perhaps a Collector could then impose a 
score threshold later? Any suggestions here?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message