【发布时间】:2018-05-01 03:01:15
【问题描述】:
我正在使用 curl 使用批量 API 将 apache logrows 作为文档添加到 elasticsearch。我发布以下内容:
{"index": {"_type": "apache", "_id": "123", "_index": "apache-2017-01"}}
{"s": 200, "d": "example.se", "@t": "2017-01-01T00:00:00.000Z", "p": "/foo"}
{"index": {"_type": "apache", "_id": "124", "_index": "apache-2017-01"}}
{"s": 200, "d": "example.se", "@t": "2017-01-01T00:00:00.000Z", "p": "/bar"}
... more of the same ...
我的猜测是,对于每个 logrow 文档行,lucene 索引都会更新它的索引。但我不需要 elasticsearch 来做到这一点。我可以先添加 all logrow 文档,然后再更新索引。
这可能吗?这是个好主意吗?它会大大提高性能吗?
【问题讨论】:
-
批量 API 的全部意义在于以一种有效的方式执行一堆索引/删除操作。您为什么怀疑 Elasticsearch 效率低下?
标签: curl elasticsearch lucene