lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <>
Subject Re: TermFreqVector
Date Fri, 18 Nov 2005 13:35:35 GMT
On the 1.9 code base, you construct a Term Vector by doing something like:

Document doc = ...

doc.add(new Field("contents", "some value", Field.Store.YES, 

Check out the javadocs for field construction.  Once you have done this, 
your code below should work, assuming document 0 exists.

Anna Buczak wrote:

>I have indexed a set of documents that do not have fields.  I want to
>use the getTermFreqVector method from IndexReader to get the
>frequencies.  However when I do that as:
>TermFreqVector[] z = ir.getTermFreqVectors(0);
>z is null.  So I can't get the frequency vectors.
>Help will be very much appreciated.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

Grant Ingersoll 
Sr. Software Engineer 
Center for Natural Language Processing 
Syracuse University 
School of Information Studies 
337 Hinds Hall 
Syracuse, NY 13244 
Voice:  315-443-5484 
Fax: 315-443-6886 

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

View raw message