The updateCollections operation lets you update collection configurations.
Note that you cannot create new collections with this operation; you can only update existing collections.
The updateCollections operation lets you update multiple collections with the same request. To do so, use multiple collectionUpdate elements within the updateCollections structure. Keep in mind, however, that an updateCollections operation that updates multiple collections is atomic, which means that either the entire operation is successful, (that is, all collections are successfully updated), or the entire operation fails if at least one of the updates fail (that is, none of the collections is updated).
<updateCollections> <outerTransactionId>?</outerTransactionId> <language>en</language> <collectionUpdate collectionKey="?" displayName="?" uniquePropertyKey="?"> <description>?</description> <property key="?">?</property> </collectionUpdate> </updateCollections>
The outerTransactionId and language attributes are optional.
collectionUpdate attribute | Description |
---|---|
collectionKey | Required. The name of the collection to be updated. Note that you cannot change the name of the collection key. |
displayName | Optional. If this attribute is used, the display name is changed to the specified value. If omitted, the last assignment is kept. |
uniquePropertyKey | Optional. The name of the collection unique property key. If this attribute is omitted or left blank, the last assignment is kept. Note that you cannot change the name of the unique property key. |
description | Optional. If this attribute is used, the collection's description is changed to the specified value. If omitted, the last assignment is kept. |
property key | Optional. You can use this attribute as
follows:
|
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.endeca.com/endeca-server/sconfig/3/0"> <soapenv:Header/> <soapenv:Body> <ns:updateCollections> <ns:language>en</ns:language> <ns:collectionUpdate collectionKey="SalesRecs" displayName="Sales Order Records"> <ns:description>All sales order records for the company</ns:description> <ns:property key="Locale">US East Coast</ns:property> </ns:collectionUpdate> </ns:updateCollections> </soapenv:Body> </soapenv:Envelope>
The example updates the collection's display name and description, and adds the Locale metadata property. Note that the collection's uniquePropertyKey parameter is not used for the request.
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Header/> <env:Body> <ns2:updateCollectionsResponse xmlns:ns2="http://www.endeca.com/endeca-server/sconfig/3/0"> <ns2:numCollectionsUpdated>2</ns2:numCollectionsUpdated> </ns2:updateCollectionsResponse> </env:Body> </env:Envelope>
In the example, two collections were updated. If the updateCollections operation was not successful, the numCollectionsUpdated element will have 0 (zero) as its value.