Solr:我应该索引大字段吗?

时间:2014-07-01 08:39:27

标签: solr indexing

使用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"/>

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

我非常感谢任何有助于我了解不对这个大字段编制索引的好处或索引编制索引的好处的信息。

1 个答案:

答案 0 :(得分:1)

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

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