@InterfaceStability.Experimental @InterfaceAudience.Public public class Index extends Object
DSL starting point for creating and managing N1QL indexes.
Modifier and Type | Field and Description |
---|---|
static String |
PRIMARY_NAME
The expected name given to the primary indexes by the server.
|
Constructor and Description |
---|
Index() |
Modifier and Type | Method and Description |
---|---|
static BuildIndexPath |
buildIndex()
Triggers building of indexes that have been deferred.
|
static OnPath |
createIndex(String indexName)
Create a new secondary index.
|
static OnPrimaryPath |
createNamedPrimaryIndex(String customPrimaryName)
Create a new primary index with a custom name.
|
static OnPrimaryPath |
createPrimaryIndex()
Create a new primary index.
|
static UsingPath |
dropIndex(String keyspace,
String indexName)
Drop a secondary index in the given keyspace.
|
static UsingPath |
dropIndex(String namespace,
String keyspace,
String indexName)
Drop a secondary index in the given namespace:keyspace.
|
static UsingPath |
dropNamedPrimaryIndex(String keyspace,
String customPrimaryName)
Drop the primary index in the given keyspace that has a custom name.
|
static UsingPath |
dropNamedPrimaryIndex(String namespace,
String keyspace,
String customPrimaryName)
Drop the primary index of the given namespace:keyspace that has a custom name.
|
static UsingPath |
dropPrimaryIndex(String keyspace)
Drop the primary index in the given keyspace.
|
static UsingPath |
dropPrimaryIndex(String namespace,
String keyspace)
Drop the primary index of the given namespace:keyspace.
|
public static final String PRIMARY_NAME
The expected name given to the primary indexes by the server.
public static OnPath createIndex(String indexName)
Create a new secondary index.
indexName
- the name of the new index (will be escaped).public static OnPrimaryPath createPrimaryIndex()
Create a new primary index.
public static OnPrimaryPath createNamedPrimaryIndex(String customPrimaryName)
Create a new primary index with a custom name.
public static BuildIndexPath buildIndex()
Triggers building of indexes that have been deferred. Note that this feature is currently only supported for GSI indexes, so the final using clause
should be explicit and use the GSI index type
.
public static UsingPath dropIndex(String namespace, String keyspace, String indexName)
Drop a secondary index in the given namespace:keyspace.
namespace
- the namespace prefix (will be escaped).keyspace
- the keyspace (bucket, will be escaped).indexName
- the name of the index to be dropped (will be escaped).public static UsingPath dropIndex(String keyspace, String indexName)
Drop a secondary index in the given keyspace.
keyspace
- the keyspace (bucket, will be escaped).indexName
- the name of the index to be dropped (will be escaped).public static UsingPath dropPrimaryIndex(String namespace, String keyspace)
Drop the primary index of the given namespace:keyspace.
namespace
- the namespace prefix (will be escaped).keyspace
- the keyspace (bucket, will be escaped).if the primary index name has been customized.
public static UsingPath dropPrimaryIndex(String keyspace)
Drop the primary index in the given keyspace.
keyspace
- the keyspace (bucket, will be escaped).if the primary index name has been customized.
public static UsingPath dropNamedPrimaryIndex(String namespace, String keyspace, String customPrimaryName)
Drop the primary index of the given namespace:keyspace that has a custom name.
namespace
- the namespace prefix (will be escaped).keyspace
- the keyspace (bucket, will be escaped).customPrimaryName
- the custom name for the primary index (will be escaped).public static UsingPath dropNamedPrimaryIndex(String keyspace, String customPrimaryName)
Drop the primary index in the given keyspace that has a custom name.
keyspace
- the keyspace (bucket, will be escaped).customPrimaryName
- the custom name for the primary index (will be escaped).Copyright © 2015 Couchbase, Inc.