【问题标题】:do not index all fields using plucene::simple不要使用 plucene::simple 索引所有字段
【发布时间】:2013-03-23 14:06:09
【问题描述】:

我正在寻找用于存储大量数据的 plucene,我对此很陌生。数据的每条记录都有一个唯一的 ID 和另外 3 个字段。这些字段有很多文本,但我只希望 id 可搜索/索引,因此当我提供 id 时,我可以检索其他字段。一个简单的示例代码如下:

my $newIndex = Plucene::Simple->open("data");
$newIndex->add(id1 => {pubmedID => "1223323", title => "a_title", abstract => "an abstract"}); 
my @results = $newIndex->search("1223323");

我正在尝试使用 plucene::simple 并且我有 2 个问题/问题:

  1. 我看不到不索引某些字段的选项。
  2. @results 数组中我会得到'id1'。我怎样才能回来,例如抽象领域?

提前致谢

【问题讨论】:

    标签: lucene indexing pubmed


    【解决方案1】:

    查看 Plucene::Document::Field 以设置索引和存储选项。您希望在索引时拥有所有 4 个字段,但只会索引“idl”(存储其他 3 个字段)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-10
      • 2015-11-16
      • 2021-10-29
      • 1970-01-01
      • 2012-10-15
      • 1970-01-01
      • 2016-09-27
      • 1970-01-01
      相关资源
      最近更新 更多