lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
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 Spans.next() returns true.

Doug

---------------------------------------------------------------------
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