如何获得Lucene中的术语抵消? [英] How get the offset of term in Lucene?
本文介绍了如何获得Lucene中的术语抵消?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Lucene中得到一个术语的抵消.我怎么得到它?
I want to get the offset of one term in the Lucene . How can i get it ?
我将内容设置为
Field.TermVector.WITH_POSITIONS_OFFSETS
Lucene中有什么方法可以抵消我在一个文档中的用语吗?
Is there any method in Lucene that give me offset of the term in one Document ?
推荐答案
尝试一下:
TermPositionVector vector = (TermPositionVector) reader.getTermFreqVector(docId, myfield);
请参见 http://lucene.apache.org/core/3_0_3/api/core/org/apache/lucene/index/TermPositionVector.html 即可获取所需的信息.
See http://lucene.apache.org/core/3_0_3/api/core/org/apache/lucene/index/TermPositionVector.html to get the info you want.
这篇关于如何获得Lucene中的术语抵消?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文