In JSON format, you can use a PATCH endpoint to modify the configuration of a search interface by adding attributes to it or changing the values of existing attributes. For example, the following endpoint modifies the configuration of the search interface All
:
PATCH /gsadmin/v1/cloud/searchInterfaces/All
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 an endpoint 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.displayName" }, { "attribute": "product.brand" }, { "attribute": "ecr:crossField" }, { "attribute": "product.category" }, { "snippetSize": 20, "attribute": "product.short_desc" } ] }
You can also use to PATCH to modify the values of existing attributes. For example, size from 20 to 25, you can execute the PATCH method with the following input:
{ "ecr:type": "search-interface", "fields": [ { "snippetSize": 25, "attribute": "product.short_desc" } ] }
Note: You cannot re-order the field members in a search interface using PATCH.