加载中

norms

Norms 存储各种规范化因子,这些因子随后会在查询时用于计算文档相对于某个查询的得分。

尽管对评分很有用,但 norms 也需要消耗相当多的磁盘空间(通常约为索引中每个字段每篇文档一个字节,即使是那些没有该特定字段的文档也不例外)。因此,如果您不需要对某个特定字段进行评分,您应该禁用该字段的 norms。特别是对于仅用于过滤或聚合的字段,更应如此。

提示

可以使用 更新映射 API (update mapping API) 在现有字段上禁用 norms。

可以通过以下方式使用 更新映射 API (update mapping API) 来禁用 norms(但事后无法重新启用):

				PUT my-index-000001/_mapping
					{
  "properties": {
    "title": {
      "type": "text",
      "norms": false
    }
  }
}
		
注意

Norms 不会被立即删除,而是在您持续索引新文档、旧段(segments)合并为新段的过程中逐渐被移除。对已移除 norms 的字段进行任何得分计算都可能会返回不一致的结果,因为某些文档不再包含 norms,而其他文档可能仍然包含 norms。

© . This website operates independently and is not affiliated with or endorsed by Elasticsearch B.V. All brand names, logos, and trademarks are the property of their respective owners.