我想在 Lucene 中获得一个术语的偏移量。我怎么才能得到它 ?
我将我的内容矢量化为
Field.TermVector.WITH_POSITIONS_OFFSETS
Lucene 中是否有任何方法可以让我抵消一个 Document 中的术语?
试试这个:
TermPositionVector vector = (TermPositionVector) reader.getTermFreqVector(docId, myfield);
请参阅http://lucene.apache.org/core/3_0_3/api/core/org/apache/lucene/index/TermPositionVector.html以获取您想要的信息。