Elasticsearch批量插入:是否已创建文档但未创建?

时间:2017-10-31 07:32:25

标签: elasticsearch bulkinsert

我使用批量插入一次插入100..1000个文档。每个doc都是100..1500字节长,所有这些都插入到相同的索引中,相同的映射类型_id是自动生成的。数据来自日志文件,所以我很确定之前索引中没有这样的文档。

插入没有返回任何错误,所以我假设文档已成功插入。但是,当我检查索引(_cat/indices)中文档的数量和大小时,它们保持不变!

我已经检查了已删除文件的数量,但它非常低(在此期间少于5)。为什么没有插入文档或为什么没有错误?

插入样本:

{ "index" : { "_type" : "default"} }
{"@timestamp":"2017-10-30T06:25:57.597369","@message":{"0":{"file":"\/core\/model\/mysql.php","line":"272","msg":"sql end","query_id":"6967ed6decd5cf9a72f99872b7e38238","duration":"0.038952112197876"},"pid":7700,"i":"i-0d93e","u":"107480"}}

回应是这样的:

Array
(
    [took] => 24
    [errors] =>
    [items] => Array
        (
            [0] => Array
                (
                    [index] => Array
                        (
                            [_index] => dump_log
                            [_type] => default
                            [_id] => AV9xPp6aE9w_DiFlsbmv
                            [_version] => 1
                            [result] => created
                            [_shards] => Array
                                (
                                    [total] => 2
                                    [successful] => 1
                                    [failed] => 0
                                )

                            [created] => 1
                            [status] => 201
                        )

                )
....

0 个答案:

没有答案