将文档插入弹性搜索

Insert documents into elastic search

我在邮递员上使用 PUT http://localhost:9200/task_idx4 创建了这个索引:

{
    "settings": {
        "index": {
            "sort.field": [ "created_at", "id.raw" ],
            "sort.order": [ "desc", "desc" ]
        }
    },
    "mappings": {
        "properties": {
            "id": { "type": "wildcard", "fields": { "raw": { "type": "keyword" }}},
            "current_status": { "type": "keyword" },
            "version_rev":    { "type": "keyword" },
            "tracking_id":     { "type": "wildcard" },
            "invoice_number":  { "type": "keyword" },
            "created_at":     { "type": "date" }
        }
    }
}

我尝试使用以下方法将文档插入此索引: PUT http://localhost:9200/task_idx4/_doc

{
    "id": "xxxx",
    "current_status": "unassigned",
    "version_rev": "xxx",
    "tracking_id": "xxx",
    "invoice_number": "xxx",
    "created_at": "2021-03-23 11:00:05.054595 +00:00"
}

返回的错误是:

{
    "error": {
        "root_cause": [
            {
                "type": "cluster_block_exception",
                "reason": "index [task_idx4] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"
            }
        ],
        "type": "cluster_block_exception",
        "reason": "index [task_idx4] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"
    },
    "status": 429
}

如何将文档插入到我的索引中?谢谢

disk usage exceeded flood-stage watermark

这里的问题是您的硬盘上没有任何 space。

您可以使用 df 命令进行检查,但显然您的磁盘使用率已超过 95%,因此您需要腾出一些空间(理想情况下低于 80%)才能对数据进行索引。