To modify the configuration of a search interface., use a PATCH request. For example, the following PATCH request modifies the configuration of the search interface All
:
PATCH /gsadmin/v1/cloud/searchInterfaces/All
The configuration used to modify the search interface All
must be included in the body of the PATCH
request.
For example, suppose that the search interface All
is currently configured as follows:
{ "ecr:lastModifiedBy": "admin", "ecr:lastModified": "2016-07-07T17:17:07.474-04:00", "ecr:createDate": "2016-05-06T17:15:06.414-04:00", "ecr:type": "search-interface", "crossFieldMatch": "always", "fields": [ { "attribute": "product.displayName" }, { "attribute": "product.brand" }, { "attribute": "ecr:crossField" }, { "attribute": "product.category" } ] }
You can add a snippet size attribute to this configuration by executing a PATCH request above with the following input:
{ "ecr:type": "search-interface", "fields": [ { "snippetSize": 20, "attribute": "product.short_desc" } ] }
The search interface ALL
is now configured as follows:
{ "ecr:lastModifiedBy": "admin", "ecr:lastModified": "2016-07-07T17:17:07.474-04:00", "ecr:createDate": "2016-05-06T17:15:06.414-04:00", "ecr:type": "search-interface", "crossFieldMatch": "always", "fields": [ { "attribute": "product.id" }, { "attribute": "product.sku" }, { "attribute": "ecr:crossField" }, { "snippetSize": 20, "attribute": "product.short_desc" } ] }
You can also use to PATCH to modify the value of existing attributes. For example, to change the snippet size from 20 to 25, for you can execute the PATCH method with the following input:
{ "ecr:type": "search-interface", "fields": [ { "snippetSize": 25, "attribute": "product.short_desc" } ] }