Hi Vitaly, On Fri, Dec 7, 2012 at 3:24 PM, <vitaly_arte...@mcafee.com> wrote:
> I try to use or Terms tfvector = reader.getTermVector(docId, "contents"); > or Fields fields = reader.getTermVectors(docId); > but I get null from these calls. > What is wrong? These methods will always return null unless you turn term vectors on at indexing time (see FieldType.setStoreTermVectors[1] and FieldType.setStoreTermVectorPositions[2]). [1] http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/document/FieldType.html#setStoreTermVectors(boolean) [2] http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/document/FieldType.html#setStoreTermVectorPositions(boolean) -- Adrien