Is there a way to read the term vector of a document along with the positions of each term?
During the creation of the index I am enabling the positions, freq etc
FieldType fieldType = new FieldType();
fieldType.setStoreTermVectors(true);
fieldType.setStoreTermVectorPositions(true);
fieldType.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS);
fieldType.setStored(true);
while reading the search index, I am getting the Termvector using
Terms termVector=indexReader.getTermVector(docId, "content"); TermsEnum termsEnum = termVector.iterator();
The termsEnum seems to be unpositioned and I am not sure how to get the position value for each term of a document.
Appreciate anyone's help on this.