You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Tom Burton-West <tb...@umich.edu> on 2013/10/26 00:30:31 UTC
Lucene40TermVectorsReader TVTermsEnum totalTermFreq() is not a total
Hi all,
I was reading some code that calls Lucene40TermVectorsReader
TVTermsEnum
The method totalTermFreq() actually returns freq and the method docFreq()
returns 1.
Once you think about the context this sort of makes sense but I found this
confusing.
I'm guessing there is a good reason for the method to be called
totalTermFreq(), but I would like to know what that is. Also is there
documentation somewhere in the javadocs that explains this?
Better yet, is there a good example of how to use the Lucene 4.x
TermVectors API?
Tom
Re: Lucene40TermVectorsReader TVTermsEnum totalTermFreq() is not a total
Posted by Michael McCandless <lu...@mikemccandless.com>.
totalTermFreq() tells you how many times this term occurred across the
entire index, I think TermsEnum.totaltermFreq javadocs explain this?
But, term vectors are an inverted index over a single document, so in
that context, totalTermFreq tells you how many times that term
occurred in that document. Basically, it's the sum over a single
document.
Maybe we could improve the term vectors docs to explain that it's
really a single-doc inverted index?
Mike McCandless
http://blog.mikemccandless.com
On Fri, Oct 25, 2013 at 6:30 PM, Tom Burton-West <tb...@umich.edu> wrote:
> Hi all,
>
> I was reading some code that calls Lucene40TermVectorsReader
> TVTermsEnum
>
> The method totalTermFreq() actually returns freq and the method docFreq()
> returns 1.
> Once you think about the context this sort of makes sense but I found this
> confusing.
>
> I'm guessing there is a good reason for the method to be called
> totalTermFreq(), but I would like to know what that is. Also is there
> documentation somewhere in the javadocs that explains this?
>
> Better yet, is there a good example of how to use the Lucene 4.x TermVectors
> API?
>
>
> Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org