lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: Word co-occurrences counts
Date Fri, 24 Dec 2004 00:46:22 GMT
Doug Cutting wrote:
> You could use a custom Similarity implementation for this query, where 
> tf() is the identity function, idf() returns 1.0, etc., so that the 
> final score is the occurance count.  You'll need to divide by 
> Similarity.decodeNorm(indexReader.norms("field")[doc]) at the end to get 
> rid of the lengthNorm() and field boost (if any).

Much simpler would be to build a SpanNearQuery, call getSpans(), then 
loop, counting how many times returns true.


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

View raw message