You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Rok Rejc <ro...@gmail.com> on 2012/03/23 14:29:54 UTC

Lucene 4.0 getTermFreqVector and TermVectorMapper

Hi all,

I have upgraded my code to the latest trunk version.

I my code I was using indexReader's function getTermFreqVector(spans.doc(),
"Text", mapper);  and my mapper based on the TermVectorMapper (to count all
the different collocators around the hit).

In the latest version the function getTermFreqVector and the class
TermVectorMapper dont exists anymore. What is the mechahism that has
replaced mentioned function and class? Are there any documents about that?
I have checked the migration.txt but have not found anything useful.

Many thanks and have a nice week-end.

Rok

Re: Lucene 4.0 getTermFreqVector and TermVectorMapper

Posted by Michael McCandless <lu...@mikemccandless.com>.
Hi,

The equivalent in trunk is IndexReader.getTermVectors.

It returns a Fields instance, just like "normal" postings
(IndexReader.fields()), except it's postings for just a single
document.

So, you can pull a specific field, iterate the terms, get the
positions/offsets, etc.

I'll update MIGRATE.txt to note this.

Mike McCandless

http://blog.mikemccandless.com

On Fri, Mar 23, 2012 at 9:29 AM, Rok Rejc <ro...@gmail.com> wrote:
> Hi all,
>
> I have upgraded my code to the latest trunk version.
>
> I my code I was using indexReader's function getTermFreqVector(spans.doc(),
> "Text", mapper);  and my mapper based on the TermVectorMapper (to count all
> the different collocators around the hit).
>
> In the latest version the function getTermFreqVector and the class
> TermVectorMapper dont exists anymore. What is the mechahism that has
> replaced mentioned function and class? Are there any documents about that?
> I have checked the migration.txt but have not found anything useful.
>
> Many thanks and have a nice week-end.
>
> Rok

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org