为什么全局序数建立在字段数据而不是doc_values上?

时间:2015-05-13 14:54:53

标签: elasticsearch lucene

我有一个字段" location"像这样

 "location": {
        "type": "string",
        "index": "not_analyzed",
        "store": true,
        "fielddata": {
          "format": "doc_values"
        }
      },

但是,当我在这个字段中使用Term Aggregation时,我会看到这种日志

[2015-05-13 15:42:56.210][DEBUG][index.fielddata.plain] Global-ordinals[location][361372] took 206 ms
[2015-05-13 17:55:44.692][DEBUG][index.fielddata.plain] Global-ordinals[location][461584] took 230 ms
[2015-05-13 17:56:21.907][DEBUG][index.fielddata.plain] Global-ordinals[location][263096] took 1205 ms

并且我也可以看到Java堆大小已经增加,结果是旧的垃圾收集。

为什么doc_values字段使用java堆?因为我也存储它们? 我可以避免垃圾收集吗?

1 个答案:

答案 0 :(得分:2)

全局序数是将字段中的每个唯一术语映射到唯一编号的结构。这需要生成,以便内存指纹和计算更好。

您可以详细了解全球序数here

相关问题