lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Cunningham <cun...@csiro.au>
Subject Re: Word co-occurrences counts
Date Wed, 29 Dec 2004 07:27:16 GMT
Thanks Doug,
This appears to works like a charm.

Doug Cutting wrote:

> 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


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