"document_missing_exception" 在 Opensearch client.update (python)

"document_missing_exception" at Opensearch client.update (python)

我的查询很简单 - 将 field:value 添加到现有文档,但它失败并显示 document_missing_exception 错误。 下面的代码没有参数,方便查看 我使用 opensearch py 客户端并将索引 co_type 设置为索引、文档 ID 和查询正文,如之前的 post

 query = {
            'doc': {
               "description_es": "Cuando una bella desconocida lleva al hacker inform\u00e1tico Neo a un inframundo imponente, descubre la "
                    }
                }
        print("query:::   ",query)
        response= hostClient.update(index="movies", doc_type='movies',id= "thematrix", body=query)

还是,错误是

"errorMessage": "NotFoundError(404, 'document_missing_exception', '[movies][thematrix]: document missing')",
  "errorType": "NotFoundError"

GET查询中的项目-

"hits" : [
  {
    "_index" : "movies",
    "_type" : "_doc",
    "_id" : "thematrix",
    "_score" : 1.0,
    "_source" : {
           .....

并通过客户端-

search results:: {'took': 10, 'timed_out': False, '_shards': {'total': 5, 'successful': 5, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 1, 'relation': 'eq'}, 'max_score': 0.5753642, 'hits': [{'_index': 'movies', '_type': '_doc', '_id': 'thematrix', '_score': 0.5753642, '_source': {'title': 'The Matrix', 'type': 'movie', 'listed_in': 'Action,Adventure,Sci-Fi,Thriller', 'description': 'When a beautiful stranger leads computer hacker Neo to a forbidding underworld, he discovers the shocking truth--the life he knows is the elaborate deception of an evil cyber-intelligence.', 'director': 'The Wachowski Brothers', 'release_year': 1999, 'cast': 'Keanu Reeves,Laurence Fishburne,Carrie-Anne Moss', 'country': 'United States', 'rating': 'PG-13', 'duration': '102 min', 'image_url': 'https://static.wikia.nocookie.net/matrix/images/5/56/The_Matrix_digital_release_cover.jpg/revision/latest/scale-to-width-down/1000?cb=20210908111245'}}]}}

少了什么?

您使用的 Elasticsearch 版本是什么?

请尝试给予

"doc_type" as "_doc".

如果您使用的是 ES 7.0 版,请尝试删除 doc_type