Class CoreQueryIndex
- java.lang.Object
-
- com.couchbase.client.core.api.manager.CoreQueryIndex
-
-
Constructor Summary
Constructors Constructor Description CoreQueryIndex(QueryChunkRow row)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbucketName()If present, returns the name of the bucket this index is stored in.Optional<String>collectionName()If present, returns the name of the collection this index is stored in.Optional<String>condition()Returns theStringrepresentation of the index's condition (the WHERE clause of the index), or an empty Optional if no condition was set.com.couchbase.client.core.deps.com.fasterxml.jackson.databind.node.ArrayNodeindexKey()Returns anarrayof Strings that represent the index key(s).Stringkeyspace()Returns the keyspace of this index.Stringname()Returns the name of this index.Stringnamespace()Returns the namespace of this index.Optional<String>partition()If present, returns the configured partition for the index.booleanprimary()True if this index is a primary index.com.couchbase.client.core.deps.com.fasterxml.jackson.databind.node.ObjectNoderaw()Returns the JSON as it arrived from the server.Optional<String>scopeName()If present, returns the name of the scope this index is stored in.Stringstate()Returns the state in which the index is in (i.e.Stringtype()Returns the index type (most likely "gsi").
-
-
-
Constructor Detail
-
CoreQueryIndex
public CoreQueryIndex(QueryChunkRow row)
-
-
Method Detail
-
primary
public boolean primary()
True if this index is a primary index.- Returns:
- true if this index is a primary index.
-
name
public String name()
Returns the name of this index.- Returns:
- the name of the index.
-
type
public String type()
Returns the index type (most likely "gsi").- Returns:
- the type of the index.
-
state
public String state()
Returns the state in which the index is in (i.e. "online").- Returns:
- the state of the index.
-
keyspace
public String keyspace()
Returns the keyspace of this index.If the index is at the bucket-level, this will return the bucket name. If the index is at the collection-level, the keyspace is the name of the collection.
- Returns:
- the keyspace of this index.
-
namespace
public String namespace()
Returns the namespace of this index.The namespace should not be confused with the keyspace - the namespace usually is "default".
- Returns:
- the namespace of this index.
-
indexKey
public com.couchbase.client.core.deps.com.fasterxml.jackson.databind.node.ArrayNode indexKey()
Returns anarrayof Strings that represent the index key(s).The array is empty in the case of a PRIMARY INDEX.
Note that the query service can present the key in a slightly different manner from when you declared the index: for instance, it will show the indexed fields in an escaped format (surrounded by backticks).
- Returns:
- an array of Strings that represent the index key(s), or an empty array in the case of a PRIMARY index.
-
condition
public Optional<String> condition()
Returns theStringrepresentation of the index's condition (the WHERE clause of the index), or an empty Optional if no condition was set.Note that the query service can present the condition in a slightly different manner from when you declared the index: for instance it will wrap expressions with parentheses and show the fields in an escaped format (surrounded by backticks).
- Returns:
- the condition/WHERE clause of the index or empty string if none.
-
partition
public Optional<String> partition()
If present, returns the configured partition for the index.- Returns:
- the partition if set, empty if none.
-
scopeName
public Optional<String> scopeName()
If present, returns the name of the scope this index is stored in.- Returns:
- the name of the scope, if present.
-
bucketName
public String bucketName()
If present, returns the name of the bucket this index is stored in.- Returns:
- the name of the bucket, if present.
-
collectionName
public Optional<String> collectionName()
If present, returns the name of the collection this index is stored in.- Returns:
- the name of the collection, if present.
-
raw
public com.couchbase.client.core.deps.com.fasterxml.jackson.databind.node.ObjectNode raw()
Returns the JSON as it arrived from the server.- Returns:
- the raw JSON representation of the index information, as returned by the query service.
-
-