- def es_repo_update(git_repo, repo_info)
- body = {
"doc": repo_info,
"doc_as_upsert": true
- }
- @es_client.update(index: 'repo', type: '_doc', id: git_repo, body: body)
you can also use compass-ci/lib/es_client.rb to create/update a doc in ES like :
es = ESClient.new(index: 'repo') es.put_source_by_id(git_repo, body) - if source exists, will update source - if source does exists, will create a new source
Thanks, Weitao
- end
end
2.23.0