【问题标题】:How get the offset of term in Lucene?如何在 Lucene 中获取 term 的偏移量?
【发布时间】:2010-05-28 15:37:12
【问题描述】:

我想获得 Lucene 中一个术语的偏移量。我怎样才能得到它?

我将我的内容向量化为

Field.TermVector.WITH_POSITIONS_OFFSETS

Lucene 中是否有任何方法可以让我在一个文档中偏移该术语?

【问题讨论】:

    标签: c# lucene offset


    【解决方案1】:

    试试这个:

    TermPositionVector vector = (TermPositionVector) reader.getTermFreqVector(docId, myfield);
    

    请参阅http://lucene.apache.org/core/3_0_3/api/core/org/apache/lucene/index/TermPositionVector.html 以获取您想要的信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-26
      • 1970-01-01
      • 1970-01-01
      • 2017-03-14
      • 1970-01-01
      • 2012-12-09
      • 1970-01-01
      相关资源
      最近更新 更多