Click or drag to resize

DatabaseCreateIndex Method

Creates an index which could be a value index from ValueIndex(IValueIndexItem) or a full-text search index from FullTextIndex(IFullTextIndexItem) with the given name. The name can be used for deleting the index. Creating a new different index with an existing index name will replace the old index; creating the same index with the same name will be no-ops.

Namespace:  Couchbase.Lite
Assembly:  Couchbase.Lite (in Couchbase.Lite.dll) Version: 2.0.0-b0713
Syntax
C#
public void CreateIndex(
	string name,
	IIndex index
)

Parameters

name
Type: SystemString
The index name
index
Type: Couchbase.Lite.QueryIIndex
The index
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown if name or index is null
CouchbaseExceptionThrown if an error condition is returned from LiteCore
InvalidOperationExceptionThrown if this method is called after the database is closed
NotSupportedExceptionThrown if an implementation of IIndex other than one of the library provided ones is used
See Also