Package de.cxp.ocs.api.indexer
Interface UpdateIndexService
-
- All Known Implementing Classes:
AbstractIndexer,ElasticsearchIndexer,ImportClient,UpdateIndexController
@Path("indexer-api/v1/update/{indexName}") public interface UpdateIndexService
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classUpdateIndexService.Result
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,UpdateIndexService.Result>deleteDocuments(String indexName, List<String> ids)Delete existing document.Map<String,UpdateIndexService.Result>patchDocuments(String indexName, List<Document> docs)Partial update of an existing document.Map<String,UpdateIndexService.Result>putDocuments(String indexName, Boolean replaceExisting, List<Document> docs)Puts a document to the index.
-
-
-
Method Detail
-
patchDocuments
@PATCH Map<String,UpdateIndexService.Result> patchDocuments(@PathParam("indexName") String indexName, List<Document> docs)
Partial update of an existing document. If the document does not exist, no update will be performed and status 404 is returned.
In case the document is a master product with variants, the provided master product may only contain the changed values. However if some data at the product variants are updated, all data from all variant products are required, otherwise missing variants won't be there after the update!
- Parameters:
indexName- name of the index that should receive that updatedocs- Full or partial document that carries the data for the update- Returns:
- Result code, one of UPDATED, NOT_FOUND, NOOP, DISMISSED
-
putDocuments
@PUT Map<String,UpdateIndexService.Result> putDocuments(String indexName, Boolean replaceExisting, List<Document> docs)
Puts a document to the index. If document does not exist, it will be added.
An existing product will be overwritten unless the parameter "replaceExisting" is set to "false".
Provided document should be a complete object, partial updates should be done using the updateDocument method.
- Parameters:
indexName- name of the index that should receive that updatedocs- The documents that should be added or updated at the index.replaceExisting- set to false to avoid overriding a document with that ID. Defaults to 'true'- Returns:
- Result code, one of CREATED, UPDATED, NOOP, DISMISSED
-
deleteDocuments
@DELETE Map<String,UpdateIndexService.Result> deleteDocuments(@PathParam("indexName") String indexName, @QueryParam("id[]") List<String> ids)
Delete existing document. If document does not exist, it returns code 404.- Parameters:
indexName- name of the index that should receive that updateids- Array of IDs of the documents that should be deleted- Returns:
- Result code, one of DELETED, NOT_FOUND
-
-