lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <>
Subject Re: How can I get a term's frequency?
Date Thu, 23 Feb 2006 00:57:43 GMT
sog wrote:
> en, but IndexReader.getTermFreqVector is an abstract method, I do not 
> know how to implement it in an efficient way. Anyone has good advise?

You probably don't need to implement it, it's been implemented already.
 Just call the method.

> I can do it in this way:
> QueryTermVector vector= new QueryTermVector(Document.getValues(field));
> freq = result.getTermFrequencies();

I'm not sure because I've never used QueryTermVector before, but the
fact that QueryTermVector doesn't take an IndexReader as a parameter is
a good indication that it can't tell you anything about the frequency of
the term in your documents.


Daniel Noll

Nuix Australia Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia
Phone: (02) 9280 0699
Fax:   (02) 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

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

View raw message