提问:布和纸怕什么?

Elasticsearch更新版本冲突问题

Elasticsearch | 作者 chaochao6411 | 发布于2019年03月25日 | 阅读数:3089

我在网上查到elasticsearch更新版本冲突的时候使用retry_on_conflict来进行反复提交,我想问下php中的retry_on_conflict应该如何设置书写?
已邀请:

rochy - rochy_he

赞同来自:

/*
$params['id'] = (string) Document ID (Required)
['index'] = (string) The name of the index (Required)
['type'] = (string) The type of the document (Required)
['consistency'] = (enum) Explicit write consistency setting for the operation
['fields'] = (list) A comma-separated list of fields to return in the response
['lang'] = (string) The script language (default: mvel)
['parent'] = (string) ID of the parent document
['refresh'] = (boolean) Refresh the index after performing the operation
['replication'] = (enum) Specific replication type
['retry_on_conflict'] = (number) Specify how many times should the operation be retried when a conflict occurs (default: 0)
['routing'] = (string) Specific routing value
['script'] = () The URL-encoded script definition (instead of using request body)
['timeout'] = (time) Explicit operation timeout
['timestamp'] = (time) Explicit timestamp for the document
['ttl'] = (duration) Expiration time for the document
['version_type'] = (number) Explicit version number for concurrency control
['body'] = (array) The request definition using either `script` or partial `doc`
['body'] = (array) Request body
*/

$params = [
// ...
];

$client = ClientBuilder::create()->build();
$response = $client->update($params);

要回复问题请先登录注册