【问题标题】:Solr: should I index large fields?Solr:我应该索引大字段吗?
【发布时间】:2014-08-21 18:05:09
【问题描述】:

使用 Apache Nutch 2.2.1 抓取网页后,该网页的内容会推送到 Solr。 Solr 将整个网页的内容存储在“内容”字段中,因此该字段中的数据通常非常庞大。所以这是我的担忧:

我应该索引 Solr 中的“内容”字段吗?索引如此大的字段将增加索引大小。在 Solr 的 schema.xml 文件中,我发现了以下建议:

NOTE: This field is not indexed by default, since it is also copied to "text"
using copyField below. This is to save space. Use this field for returning and
highlighting document content. Use the "text" field to search the content.

<field name="content" type="text_general" indexed="false" stored="true" multiValued="true"/>

但是,如果我让该字段未编入索引,是否会显着增加搜索响应时间?

如果有任何信息可以帮助我了解不对这个大型字段编制索引的好处或编制索引的好处,我将不胜感激。

【问题讨论】:

    标签: solr indexing


    【解决方案1】:

    如果您要搜索该字段,则需要对其进行索引。架构中的示例假定由于您要搜索 text 而不是 content,因此无需创建两次索引。然而,他们确实希望自己保留对 content 的引用,以便它可以显示在应用程序中或用于突出显示(这需要整个字段内容都可用)。

    如果您没有看到需要该字段进行查询的任何情况,则无需为该字段创建索引。

    【讨论】:

      猜你喜欢
      • 2020-07-29
      • 2021-09-15
      • 2010-09-18
      • 1970-01-01
      • 2013-01-03
      • 1970-01-01
      • 2011-10-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多