The SConfig Web Service has two operations to create collections.
The putCollection operation creates a single collection, while the putCollections operation can create multiple collections at once. Both operations result in a CDR (Collection Definition Record) being created in the Dgraph.
<putCollection> <outerTransactionId>?</outerTransactionId> <language>en</language> <collection collectionKey="?" displayName="?" uniquePropertyKey="?"> <description>?</description> <property key="?">?</property> </collection> </putCollection>
Collection attribute | Description |
---|---|
collectionKey | Required. A unique identifier for the collection. The key name does not have to be in the NCName format, but must be unique among collection names. The name is case-sensitive when used with other collection operations or in queries. |
displayName | Optional. Defines the display name which may be used by the front-end application, such as Studio. The display name can be any arbitrary string. |
uniquePropertyKey | Required. Sets the standard attribute that
provides the unique key values for records in the collection. Once a
uniquePropertyKey is configured for a
collection, it cannot be used for any other collection. In addition, this
standard attribute must not already be assigned on any record.
The PDR for the standard attribute must be created with:
Note that the this standard attribute will also serve as the primary key (record spec) for the records in this collection. |
description | Optional. Provides descriptive text about the collection. |
property key | Optional. Lets you associate a string metadata property for the collection (for example, locale information). The key name must be in the NCName format |
<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:putCollection> <ns:language>en</ns:language> <ns:collection collectionKey="Products" displayName="Product data" uniquePropertyKey="ProductID"> <ns:description>product records for the region</ns:description> <ns:property key="Region">New England</ns:property> </ns:collection> </ns:putCollection> </soapenv:Body> </soapenv:Envelope>
The existing ProductID standard attribute is used as the collection's unique property key. The collection also has an associated metadata that defines the Region property metadata as the New England region.
<putCollections> <outerTransactionId>?</outerTransactionId> <language>en</language> <collection collectionKey="?" displayName="?" uniquePropertyKey="?"> <description>?</description> <property key="?">?</property> </collection> </putCollections>
You can supply multiple collection elements, which have the same syntax and meanings as in the single-use putCollection operation.
<putCollectionResponse xmlns="http://www.endeca.com/endeca-server/sconfig/3/0"> <collectionAdditionInformation numCollectionsAdded="1" numCollectionsReplaced="0"/> </putCollectionResponse>
The response shows that one new collection was added.