beautypg.com

Collections, Creating a collection – Google Search Appliance Administrative API Developers Guide: .NET User Manual

Page 22

background image

Google Search Appliance: Administrative API Developer’s Guide: .NET

22

Collections

Retrieve, update, create, or delete the collections of documents on the search appliance.

Creating a Collection

Create a new collection as follows:

// Create an entry to hold properties to insert
GsaEntry insertEntry = new GsaEntry();

// Add a property to insertEntry
insertEntry.AddGsaContent("collectionName", "new_collection");
insertEntry.AddGsaContent("insertMethod", "default");

// Send the request
myService.InsertEntry("collection", insertEntry);

Create a new collection with a default setting as follows:

insertEntry.AddGsaContent("insertMethod", "default");

Specify the settings for a new collection as follows:

// Add property for insertEntry
insertEntry.AddGsaContent("collectionName", "new_collection");
insertEntry.AddGsaContent("insertMethod", "customize");
insertEntry.AddGsaContent("followURLs", "#url to follow");
insertEntry.AddGsaContent("doNotCrawlURLs", "#url to not follow");

Property

Description

collectionName

The name of the collection to create, which is only required when
creating a new collection.

doNotCrawlURLs

The URL patterns of content that you want to exclude from this
collection.

followURLs

The URL patterns of content that you want to include in this collection.

importData

Indicates that the collection settings exported from the Admin Console
are only required when creating a new collection from an import.

insertMethod

The method of creating a new method, which is only required when
creating a new collection. Possible values: default, customize,
import.