Class UpdateIndexController

    • Constructor Detail

      • UpdateIndexController

        public UpdateIndexController()
    • Method Detail

      • patchDocuments

        @PatchMapping
        public Map<String,​UpdateIndexService.Result> patchDocuments​(@PathVariable("indexName")
                                                                          String indexName,
                                                                          @RequestBody
                                                                          List<Document> documents)
        Description copied from interface: UpdateIndexService

        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!

        Specified by:
        patchDocuments in interface UpdateIndexService
        Parameters:
        indexName - name of the index that should receive that update
        documents - Full or partial document that carries the data for the update
        Returns:
        Result code, one of UPDATED, NOT_FOUND, NOOP, DISMISSED
      • putDocuments

        @PutMapping
        public Map<String,​UpdateIndexService.Result> putDocuments​(@PathVariable("indexName")
                                                                        String indexName,
                                                                        @RequestParam(name="replaceExisting",defaultValue="true")
                                                                        Boolean replaceExisting,
                                                                        @RequestBody
                                                                        List<Document> documents)
        Description copied from interface: UpdateIndexService

        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.

        Specified by:
        putDocuments in interface UpdateIndexService
        Parameters:
        indexName - name of the index that should receive that update
        replaceExisting - set to false to avoid overriding a document with that ID. Defaults to 'true'
        documents - The documents that should be added or updated at the index.
        Returns:
        Result code, one of CREATED, UPDATED, NOOP, DISMISSED
      • deleteDocuments

        @DeleteMapping
        public Map<String,​UpdateIndexService.Result> deleteDocuments​(@PathVariable("indexName")
                                                                           String indexName,
                                                                           @RequestParam("id")
                                                                           List<String> ids)
        Description copied from interface: UpdateIndexService
        Delete existing document. If document does not exist, it returns code 404.
        Specified by:
        deleteDocuments in interface UpdateIndexService
        Parameters:
        indexName - name of the index that should receive that update
        ids - Array of IDs of the documents that should be deleted
        Returns:
        Result code, one of DELETED, NOT_FOUND