mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-05 20:48:22 +00:00
e6b459cb9f
In the case of inserts the UpdateHelper class will now allow the script used to apply updates to run on the upsert doc provided by clients. This allows the logic for managing the internal state of the data item to be managed by the script and is not reliant on clients performing the initialisation of data structures managed by the script. Closes #7143
99 lines
3.0 KiB
JSON
99 lines
3.0 KiB
JSON
{
|
|
"update": {
|
|
"documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/docs-update.html",
|
|
"methods": ["POST"],
|
|
"url": {
|
|
"path": "/{index}/{type}/{id}/_update",
|
|
"paths": ["/{index}/{type}/{id}/_update"],
|
|
"parts": {
|
|
"id": {
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "Document ID"
|
|
},
|
|
"index": {
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "The name of the index"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "The type of the document"
|
|
}
|
|
},
|
|
"params": {
|
|
"consistency": {
|
|
"type": "enum",
|
|
"options": ["one", "quorum", "all"],
|
|
"description": "Explicit write consistency setting for the operation"
|
|
},
|
|
"fields": {
|
|
"type": "list",
|
|
"description": "A comma-separated list of fields to return in the response"
|
|
},
|
|
"lang": {
|
|
"type": "string",
|
|
"description": "The script language (default: groovy)"
|
|
},
|
|
"parent": {
|
|
"type": "string",
|
|
"description": "ID of the parent document"
|
|
},
|
|
"refresh": {
|
|
"type": "boolean",
|
|
"description": "Refresh the index after performing the operation"
|
|
},
|
|
"replication": {
|
|
"type": "enum",
|
|
"options": ["sync", "async"],
|
|
"default": "sync",
|
|
"description": "Specific replication type"
|
|
},
|
|
"retry_on_conflict": {
|
|
"type": "number",
|
|
"description": "Specify how many times should the operation be retried when a conflict occurs (default: 0)"
|
|
},
|
|
"routing": {
|
|
"type": "string",
|
|
"description": "Specific routing value"
|
|
},
|
|
"script": {
|
|
"description": "The URL-encoded script definition (instead of using request body)"
|
|
},
|
|
"script_id": {
|
|
"description": "The id of a stored script"
|
|
},
|
|
"scripted_upsert": {
|
|
"type": "boolean",
|
|
"description": "True if the script referenced in script or script_id should be called to perform inserts - defaults to false"
|
|
},
|
|
"timeout": {
|
|
"type": "time",
|
|
"description": "Explicit operation timeout"
|
|
},
|
|
"timestamp": {
|
|
"type": "time",
|
|
"description": "Explicit timestamp for the document"
|
|
},
|
|
"ttl": {
|
|
"type": "duration",
|
|
"description": "Expiration time for the document"
|
|
},
|
|
"version": {
|
|
"type": "number",
|
|
"description": "Explicit version number for concurrency control"
|
|
},
|
|
"version_type": {
|
|
"type": "enum",
|
|
"options": ["internal", "force"],
|
|
"description": "Specific version type"
|
|
}
|
|
}
|
|
},
|
|
"body": {
|
|
"description": "The request definition using either `script` or partial `doc`"
|
|
}
|
|
}
|
|
}
|