Class CreatePrimaryQueryIndexOptions
java.lang.Object
com.couchbase.client.java.CommonOptions<CreatePrimaryQueryIndexOptions>
com.couchbase.client.java.manager.query.CreatePrimaryQueryIndexOptions
Allows customizing how a query primary index is created.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.couchbase.client.java.CommonOptions
CommonOptions.BuiltCommonOptions
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
collectionName
(String collectionName) Deprecated.`collection.queryIndexes()` should now be used for collection-related query index operations.Creates a new instance with default values.deferred
(boolean deferred) If set to true will defer building of this index (false by default).ignoreIfExists
(boolean ignoreIfExists) Set to true if no exception should be thrown if the primary index already exists (false by default).The custom name of the primary index.numReplicas
(int numReplicas) Configures the number of index replicas.Deprecated.`collection.queryIndexes()` should now be used for collection-related query index operations.Allows passing in custom options into the N1QL WITH clause for index creation.Methods inherited from class com.couchbase.client.java.CommonOptions
clientContext, parentSpan, retryStrategy, self, timeout
-
Method Details
-
createPrimaryQueryIndexOptions
Creates a new instance with default values.- Returns:
- the instantiated default options.
-
indexName
The custom name of the primary index.- Parameters:
indexName
- the custom name of the primary index.- Returns:
- this options builder for chaining purposes.
-
ignoreIfExists
Set to true if no exception should be thrown if the primary index already exists (false by default).- Parameters:
ignoreIfExists
- true if no exception should be thrown if the index already exists.- Returns:
- this options builder for chaining purposes.
-
numReplicas
Configures the number of index replicas.- Parameters:
numReplicas
- the number of replicas used for this index.- Returns:
- this options builder for chaining purposes.
-
deferred
If set to true will defer building of this index (false by default).If you are creating multiple indexes on the same bucket, you may see improved performance by creating them in deferred mode and then building them all at once. Please use
QueryIndexManager.buildDeferredIndexes(String)
afterwards to build the deferred indexes.- Parameters:
deferred
- if building this index should be deferred.- Returns:
- this options builder for chaining purposes.
-
with
Allows passing in custom options into the N1QL WITH clause for index creation.This method should only be used if no other option is available - use with caution!
- Parameters:
optionName
- the name of the WITH option.optionValue
- the value of the WITH option.- Returns:
- this options builder for chaining purposes.
-
scopeName
Deprecated.`collection.queryIndexes()` should now be used for collection-related query index operations.Sets the scope name for this query management operation.Please note that if the scope name is set, the
collectionName(String)
(String)} must also be set.- Parameters:
scopeName
- the name of the scope.- Returns:
- this options class for chaining purposes.
-
collectionName
Deprecated.`collection.queryIndexes()` should now be used for collection-related query index operations.Sets the collection name for this query management operation.Please note that if the collection name is set, the
scopeName(String)
must also be set.- Parameters:
collectionName
- the name of the collection.- Returns:
- this options class for chaining purposes.
-
build
-