lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@syr.edu>
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, 
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: java-user-unsubscribe@lucene.apache.org
>For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>  
>

-- 
------------------------------------------------------------------- 
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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message