0

Amazon CloudSearch(至少 v2)提供错误和警告,例如:

{
    "status": "success",
    "warnings": [{
        "message": "Multi-valued field \"color\" has no value (near operation with index 949)"
    },
    {
        "message": "Multi-valued field \"color_id\" has no value (near operation with index 949)"
    }],
    "adds": 1000,
    "deletes": 0
}

找出哪个文档有问题的唯一方法是解析“索引 X 的近操作”并提取该索引。

我在某处看到过一篇似乎表明它也可以返回的帖子document_id但我不确定它来自哪里。

所以我的问题有两个部分:

  1. CloudSearch 如何在错误/警告消息中返回文档 ID?
  2. 如果 #1 不可能,CloudSearch 错误/警告消息索引是基于 0 还是基于 1?
4

1 回答 1

1

Unofficial confirmation based on limited testing -- seems like the index is 1-based.

Meaning "near operation with index 949" refers to documents[948].

Knowing that, I can back-reference into the document list to append its id to the error message.

于 2014-12-30T20:35:50.050 回答