Package com.couchbase.client.java.query
Class Index
- java.lang.Object
-
- com.couchbase.client.java.query.Index
-
@Experimental @Public public class Index extends Object
DSL starting point for creating and managing N1QL indexes.- Since:
- 2.2
- Author:
- Simon Baslé
-
-
Field Summary
Fields Modifier and Type Field Description static StringPRIMARY_NAMEThe expected name given to the primary indexes by the server.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BuildIndexPathbuildIndex()Triggers building of indexes that have been deferred.static OnPathcreateIndex(String indexName)Create a new secondary index.static OnPrimaryPathcreateNamedPrimaryIndex(String customPrimaryName)Create a new primary index with a custom name.static OnPrimaryPathcreatePrimaryIndex()Create a new primary index.static UsingPathdropIndex(String keyspace, String indexName)Drop a secondary index in the given keyspace.static UsingPathdropIndex(String namespace, String keyspace, String indexName)Drop a secondary index in the given namespace:keyspace.static UsingPathdropNamedPrimaryIndex(String keyspace, String customPrimaryName)Drop the primary index in the given keyspace that has a custom name.static UsingPathdropNamedPrimaryIndex(String namespace, String keyspace, String customPrimaryName)Drop the primary index of the given namespace:keyspace that has a custom name.static UsingPathdropPrimaryIndex(String keyspace)Drop the primary index in the given keyspace.static UsingPathdropPrimaryIndex(String namespace, String keyspace)Drop the primary index of the given namespace:keyspace.
-
-
-
Field Detail
-
PRIMARY_NAME
public static final String PRIMARY_NAME
The expected name given to the primary indexes by the server.- See Also:
- Constant Field Values
-
-
Method Detail
-
createIndex
public static OnPath createIndex(String indexName)
Create a new secondary index.- Parameters:
indexName- the name of the new index (will be escaped).
-
createPrimaryIndex
public static OnPrimaryPath createPrimaryIndex()
Create a new primary index.
-
createNamedPrimaryIndex
public static OnPrimaryPath createNamedPrimaryIndex(String customPrimaryName)
Create a new primary index with a custom name.
-
buildIndex
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 finalusing clauseshould be explicit and use theGSI index type.
-
dropIndex
public static UsingPath dropIndex(String namespace, String keyspace, String indexName)
Drop a secondary index in the given namespace:keyspace.- Parameters:
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).
-
dropIndex
public static UsingPath dropIndex(String keyspace, String indexName)
Drop a secondary index in the given keyspace.- Parameters:
keyspace- the keyspace (bucket, will be escaped).indexName- the name of the index to be dropped (will be escaped).
-
dropPrimaryIndex
public static UsingPath dropPrimaryIndex(String namespace, String keyspace)
Drop the primary index of the given namespace:keyspace.- Parameters:
namespace- the namespace prefix (will be escaped).keyspace- the keyspace (bucket, will be escaped).- See Also:
if the primary index name has been customized.
-
dropPrimaryIndex
public static UsingPath dropPrimaryIndex(String keyspace)
Drop the primary index in the given keyspace.- Parameters:
keyspace- the keyspace (bucket, will be escaped).- See Also:
if the primary index name has been customized.
-
dropNamedPrimaryIndex
public static UsingPath dropNamedPrimaryIndex(String namespace, String keyspace, String customPrimaryName)
Drop the primary index of the given namespace:keyspace that has a custom name.- Parameters:
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).
-
dropNamedPrimaryIndex
public static UsingPath dropNamedPrimaryIndex(String keyspace, String customPrimaryName)
Drop the primary index in the given keyspace that has a custom name.- Parameters:
keyspace- the keyspace (bucket, will be escaped).customPrimaryName- the custom name for the primary index (will be escaped).
-
-