Query indexes
- class acouchbase.management.queries.CollectionQueryIndexManager(impl: AsyncQueryIndexMgmtInterface, bucket_name: str)
Performs management operations on query indexes at the collection level.
- async build_deferred_indexes(options: BuildDeferredQueryIndexOptions | None = None, **kwargs: Unpack[BuildDeferredQueryIndexOptionsKwargs]) None
Starts building any indexes which were previously created with
deferred=True.- Parameters:
options (
BuildDeferredQueryIndexOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- async create_index(index_name: str, keys: Iterable[str], options: CreateQueryIndexOptions | None = None, **kwargs: Unpack[CreateQueryIndexOptionsKwargs]) None
Creates a new query index.
- Parameters:
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 index_name or keys are invalid types.
QueryIndexAlreadyExistsException – If the index already exists.
- async create_primary_index(options: CreatePrimaryQueryIndexOptions | None = None, **kwargs: Unpack[CreatePrimaryQueryIndexOptionsKwargs]) None
Creates a new primary query index.
- Parameters:
options (
CreatePrimaryQueryIndexOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Raises:
QueryIndexAlreadyExistsException – If the index already exists.
- async drop_index(index_name: str, options: DropQueryIndexOptions | None = None, **kwargs: Unpack[DropQueryIndexOptionsKwargs]) None
Drops an existing query index.
- Parameters:
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 index_name is an invalid type.
QueryIndexNotFoundException – If the index does not exists.
- async drop_primary_index(options: DropPrimaryQueryIndexOptions | None = None, **kwargs: Unpack[DropPrimaryQueryIndexOptionsKwargs]) None
Drops an existing primary query index.
- Parameters:
options (
DropPrimaryQueryIndexOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Raises:
QueryIndexNotFoundException – If the index does not exists.
- async get_all_indexes(options: GetAllQueryIndexOptions | None = None, **kwargs: Unpack[GetAllQueryIndexOptionsKwargs]) Iterable[QueryIndex]
Returns a list of indexes for a specific collection.
- Parameters:
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.
- Return type:
Awaitable[Iterable[
QueryIndex]]
- async watch_indexes(index_names: Iterable[str], options: WatchQueryIndexOptions | None = None, **kwargs: Unpack[WatchQueryIndexOptionsKwargs]) None
Waits for a number of indexes to finish creation and be ready to use.
- Parameters:
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.
- class acouchbase.management.queries.QueryIndexManager(impl: AsyncQueryIndexMgmtInterface)
Performs management operations on query indexes.
For managing query indexes at the collection level,
CollectionQueryIndexManagershould be used.- async build_deferred_indexes(bucket_name: str, options: BuildDeferredQueryIndexOptions | None = None, **kwargs: Unpack[BuildDeferredQueryIndexOptionsKwargs]) 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.
- async create_index(bucket_name: str, index_name: str, keys: Iterable[str], options: CreateQueryIndexOptions | None = None, **kwargs: Unpack[CreateQueryIndexOptionsKwargs]) 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.
- async create_primary_index(bucket_name: str, options: CreatePrimaryQueryIndexOptions | None = None, **kwargs: Unpack[CreatePrimaryQueryIndexOptionsKwargs]) 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.
- async drop_index(bucket_name: str, index_name: str, options: DropQueryIndexOptions | None = None, **kwargs: Unpack[DropQueryIndexOptionsKwargs]) 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.
- async drop_primary_index(bucket_name: str, options: DropPrimaryQueryIndexOptions | None = None, **kwargs: Unpack[DropPrimaryQueryIndexOptionsKwargs]) 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.
- async get_all_indexes(bucket_name: str, options: GetAllQueryIndexOptions | None = None, **kwargs: Unpack[GetAllQueryIndexOptionsKwargs]) 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:
Awaitable[Iterable[
QueryIndex]]- Raises:
InvalidArgumentException – If the bucket_name is an invalid type.
- async watch_indexes(bucket_name: str, index_names: Iterable[str], options: WatchQueryIndexOptions | None = None, **kwargs: Unpack[WatchQueryIndexOptionsKwargs]) 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: