As the es update to 7.11, some compatibility error occurs.
[error msg] git-mirror: warning: 299 Elasticsearch-7.11.1-ff17057114c2199c9c1bbecc727003a907c0db7a "[types removal] Specifying types in doc ument update requests is deprecated, use the endpoint /{index}/_update/{id} instead."
Signed-off-by: Li Yuanchao lyc163mail@163.com --- lib/git_mirror.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/lib/git_mirror.rb b/lib/git_mirror.rb index 7f36be3..1f4e5b5 100644 --- a/lib/git_mirror.rb +++ b/lib/git_mirror.rb @@ -308,11 +308,8 @@ class MirrorMain def es_repo_update(git_repo) repo_info = { 'git_repo' => git_repo, 'url' => @git_info[git_repo]['url'] } repo_info = repo_info.merge(@fork_stat[git_repo]) - body = { - "doc": repo_info, - "doc_as_upsert": true - } - @es_client.update(index: 'repo', type: '_doc', id: git_repo, body: body) + body = repo_info + @es_client.index(index: 'repo', type: '_doc', id: git_repo, body: body) end
def update_stat_fetch(git_repo)