【发布时间】:2020-11-07 18:15:59
【问题描述】:
我使用 ElasticSearch python 模块的批量 API 将新文档添加到 ElastichSearch 中的索引。它返回成功,当我在 ElasticSearch 索引中搜索文档时,我可以找到它。所以我确定插入是正确的。但是,使用 ElastiSearch 计数 API (https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html) 我得到与插入文档之前相同的数字。这是它的输出:
epoch timestamp count
1604741686 09:34:46 1297277503
是不是因为我的索引文件太多了?
【问题讨论】:
-
插入后是否立即检查? Elasticsearch 不时刷新(可配置),因此您不会立即看到结果,而是在刷新索引之后。更多在这里 - elastic.co/guide/en/elasticsearch/reference/current/…
-
我已将 referh_interval 设置为 -1。这就是 count API 出现这种行为的原因。感谢您的回复
标签: elasticsearch