Elasticsearch allows you to perform a patch operation or a full reindex of a document based on a script. We will describe the operations as follows:
- Patch: The content changes and new fields added will be merged into the existing document. If there is no change in the content after the operation, the result field will be noop in the response body. If the document does not exist, then the response is NOT_FOUND (404) with document_missing_exception. Let's assume the market capitalization of the ACWF ETF has changed from large to mid. You can see in the following screenshot that the document version number, _version, has changed from 1 to 2:
- A full reindex of a document based on a script: Given a script in the request ...