Query indexes
- class txcouchbase.management.queries.QueryIndexManager(impl: TxQueryIndexMgmtInterface)
Performs management operations on query indexes.
- build_deferred_indexes(bucket_name: str, options: BuildDeferredQueryIndexOptions | None = None, **kwargs: Unpack[BuildDeferredQueryIndexOptionsKwargs]) Deferred[None]
Starts building any indexes which were previously created with
deferred=True.- Parameters:
bucket_name (str) – The name of the bucket to perform build on.
options (
BuildDeferredQueryIndexOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Raises:
InvalidArgumentException – If the bucket_name is an invalid type.
- create_index(bucket_name: str, index_name: str, keys: Iterable[str], options: CreateQueryIndexOptions | None = None, **kwargs: Unpack[CreateQueryIndexOptionsKwargs]) Deferred[None]
Creates a new query index.
- Parameters:
bucket_name (str) – The name of the bucket this index is for.
index_name (str) – The name of the index.
keys (Iterable[str]) – The keys which this index should cover.
options (
CreateQueryIndexOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Raises:
InvalidArgumentException – If the bucket_name, index_name or keys are invalid types.
QueryIndexAlreadyExistsException – If the index already exists.
- create_primary_index(bucket_name: str, options: CreatePrimaryQueryIndexOptions | None = None, **kwargs: Unpack[CreatePrimaryQueryIndexOptionsKwargs]) Deferred[None]
Creates a new primary query index.
- Parameters:
bucket_name (str) – The name of the bucket this index is for.
options (
CreatePrimaryQueryIndexOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Raises:
InvalidArgumentException – If the bucket_name is an invalid type.
QueryIndexAlreadyExistsException – If the index already exists.
- drop_index(bucket_name: str, index_name: str, options: DropQueryIndexOptions | None = None, **kwargs: Unpack[DropQueryIndexOptionsKwargs]) Deferred[None]
Drops an existing query index.
- Parameters:
bucket_name (str) – The name of the bucket containing the index to drop.
index_name (str) – The name of the index to drop.
options (
DropQueryIndexOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Raises:
InvalidArgumentException – If the bucket_name or index_name are invalid types.
QueryIndexNotFoundException – If the index does not exists.
- drop_primary_index(bucket_name: str, options: DropPrimaryQueryIndexOptions | None = None, **kwargs: Unpack[DropPrimaryQueryIndexOptionsKwargs]) Deferred[None]
Drops an existing primary query index.
- Parameters:
bucket_name (str) – The name of the bucket this index to drop.
options (
DropPrimaryQueryIndexOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Raises:
InvalidArgumentException – If the bucket_name is an invalid type.
QueryIndexNotFoundException – If the index does not exists.
- get_all_indexes(bucket_name: str, options: GetAllQueryIndexOptions | None = None, **kwargs: Unpack[GetAllQueryIndexOptionsKwargs]) Deferred[Iterable[QueryIndex]]
Returns a list of indexes for a specific bucket.
- Parameters:
bucket_name (str) – The name of the bucket to fetch indexes for.
options (
GetAllQueryIndexOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Returns:
A list of indexes for a specific bucket.
- Return type:
Deferred[Iterable[
QueryIndex]]- Raises:
InvalidArgumentException – If the bucket_name is an invalid type.
- watch_indexes(bucket_name: str, index_names: Iterable[str], options: WatchQueryIndexOptions | None = None, **kwargs: Unpack[WatchQueryIndexOptionsKwargs]) Deferred[None]
Waits for a number of indexes to finish creation and be ready to use.
- Parameters:
bucket_name (str) – The name of the bucket to watch for indexes on.
index_names (Iterable[str]) – The names of the indexes to watch.
options (
WatchQueryIndexOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Raises:
InvalidArgumentException – If the bucket_name or index_names are invalid types.
WatchQueryIndexTimeoutException – If the specified timeout is reached before all the specified indexes are ready to use.
This module also publishes these, described where they are first documented: