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,
Field.Index.TOKENIZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
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.
Anna
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
-------------------------------------------------------------------
Grant Ingersoll
Sr. Software Engineer
Center for Natural Language Processing
Syracuse University
School of Information Studies
337 Hinds Hall
Syracuse, NY 13244
http://www.cnlp.org
Voice: 315-443-5484
Fax: 315-443-6886
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]