【问题标题】:How to index all the terms in the document in Lucene?如何在 Lucene 中索引文档中的所有术语?
【发布时间】:2012-02-22 21:01:51
【问题描述】:

我要索引的文档非常大。默认情况下,Lucene 只索引文档的前 10,000 个术语,以避免出现 OutOfMemory 错误。所以我在搜索索引时得到了不正确的命中。我怎样才能索引文档中的所有术语?

【问题讨论】:

    标签: java lucene indexing full-text-search


    【解决方案1】:

    IndexWriter.MaxFieldLength。在 IndexWriter 构造函数中指定最大字段长度(以标记/术语的数量计)

    您可以将最大值设置为 IndexWriter 构造函数 MAX_VALUE - Lucene Recent VersionsUNLIMITED - Lucene Older Versions 的一部分。

    您也可以使用IndexWriter.setMaxFieldLength(int) 覆盖构造函数设置的值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-30
      • 2011-11-04
      • 2018-04-29
      • 1970-01-01
      • 2012-02-14
      • 1970-01-01
      相关资源
      最近更新 更多