Search indexes

class txcouchbase.management.search.ScopeSearchIndexManager(impl: TxSearchIndexMgmtInterface)

Performs management operations on the search indexes of a scope.

allow_querying(index_name: str, options: AllowQueryingSearchIndexOptions | None = None, **kwargs: Unpack[AllowQueryingSearchIndexOptionsKwargs]) → Deferred[None]

Allows querying against an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (AllowQueryingSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

analyze_document(index_name: str, document: Any, options: AnalyzeDocumentSearchIndexOptions | None = None, **kwargs: Unpack[AnalyzeDocumentSearchIndexOptionsKwargs]) → Deferred[dict[str, Any]]

Allows to see how a document is analyzed against a specific index.

Parameters:
  • index_name (str) – The name of the search index.

  • document (Any) – The document to analyze.

  • options (AnalyzeDocumentSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

The analyzed sections for the document.

Return type:

Deferred[dict[str, Any]]

Raises:

SearchIndexNotFoundException – If the index does not exist.

disallow_querying(index_name: str, options: DisallowQueryingSearchIndexOptions | None = None, **kwargs: Unpack[DisallowQueryingSearchIndexOptionsKwargs]) → Deferred[None]

Disallows querying against an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (DisallowQueryingSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

drop_index(index_name: str, options: DropSearchIndexOptions | None = None, **kwargs: Unpack[DropSearchIndexOptionsKwargs]) → Deferred[None]

Drops an index.

Parameters:
  • index_name (str) – The name of the index.

  • options (DropSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

freeze_plan(index_name: str, options: FreezePlanSearchIndexOptions | None = None, **kwargs: Unpack[FreezePlanSearchIndexOptionsKwargs]) → Deferred[None]

Freezes the assignment of index partitions to nodes for an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (FreezePlanSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

get_all_index_stats(options: GetAllSearchIndexStatsOptions | None = None, **kwargs: Unpack[GetAllSearchIndexStatsOptionsKwargs]) → Deferred[dict[str, Any]]

Retrieves statistics on the search service.

The statistics cover documents, partition indexes, mutations, compactions, queries, and more.

Note

UNCOMMITTED: This is an uncommitted API call that is unlikely to change, but may still change as final consensus on its behavior has not yet been reached.

Parameters:
  • options (GetAllSearchIndexStatsOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

The stats report.

Return type:

Deferred[dict[str, Any]]

get_all_indexes(options: GetAllSearchIndexesOptions | None = None, **kwargs: Unpack[GetAllSearchIndexesOptionsKwargs]) → Deferred[Iterable[SearchIndex]]

Fetches all indexes from the server.

Parameters:
  • options (GetAllSearchIndexesOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

A list of all indexes.

Return type:

Deferred[Iterable[SearchIndex]]

get_index(index_name: str, options: GetSearchIndexOptions | None = None, **kwargs: Unpack[GetSearchIndexOptionsKwargs]) → Deferred[SearchIndex]

Fetches an index from the server if it exists.

Parameters:
  • index_name (str) – The name of the search index.

  • options (GetSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

The index definition if it exists.

Return type:

Deferred[SearchIndex]

Raises:

SearchIndexNotFoundException – If the index does not exist.

get_index_stats(index_name: str, options: GetSearchIndexStatsOptions | None = None, **kwargs: Unpack[GetSearchIndexStatsOptionsKwargs]) → Deferred[dict[str, Any]]

Retrieves metrics, timings and counters for a given index.

Note

UNCOMMITTED: This is an uncommitted API call that is unlikely to change, but may still change as final consensus on its behavior has not yet been reached.

Parameters:
  • index_name (str) – The name of the search index.

  • options (GetSearchIndexStatsOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

The stats for the index.

Return type:

Deferred[dict[str, Any]]

Raises:

SearchIndexNotFoundException – If the index does not exist.

get_indexed_documents_count(index_name: str, options: GetSearchIndexedDocumentsCountOptions | None = None, **kwargs: Unpack[GetSearchIndexedDocumentsCountOptionsKwargs]) → Deferred[int]

Retrieves the number of documents that have been indexed for an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (GetSearchIndexedDocumentsCountOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

The number of documents indexed for the specified index.

Return type:

Deferred[int]

Raises:

SearchIndexNotFoundException – If the index does not exist.

pause_ingest(index_name: str, options: PauseIngestSearchIndexOptions | None = None, **kwargs: Unpack[PauseIngestSearchIndexOptionsKwargs]) → Deferred[None]

Pauses updates and maintenance for an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (PauseIngestSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

resume_ingest(index_name: str, options: ResumeIngestSearchIndexOptions | None = None, **kwargs: Unpack[ResumeIngestSearchIndexOptionsKwargs]) → Deferred[None]

Resumes updates and maintenance for an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (ResumeIngestSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

unfreeze_plan(index_name: str, options: UnfreezePlanSearchIndexOptions | None = None, **kwargs: Unpack[UnfreezePlanSearchIndexOptionsKwargs]) → Deferred[None]

Unfreezes the assignment of index partitions to nodes for an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (UnfreezePlanSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

upsert_index(index: SearchIndex, options: UpsertSearchIndexOptions | None = None, **kwargs: Unpack[UpsertSearchIndexOptionsKwargs]) → Deferred[None]

Creates or updates an index.

Parameters:
  • index (SearchIndex) – The index definition.

  • options (UpsertSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

InvalidArgumentException – If the index definition is invalid.

class txcouchbase.management.search.SearchIndexManager(impl: TxSearchIndexMgmtInterface)

Performs management operations on search indexes.

For managing the search indexes of a scope, ScopeSearchIndexManager should be used.

allow_querying(index_name: str, options: AllowQueryingSearchIndexOptions | None = None, **kwargs: Unpack[AllowQueryingSearchIndexOptionsKwargs]) → Deferred[None]

Allows querying against an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (AllowQueryingSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

analyze_document(index_name: str, document: Any, options: AnalyzeDocumentSearchIndexOptions | None = None, **kwargs: Unpack[AnalyzeDocumentSearchIndexOptionsKwargs]) → Deferred[dict[str, Any]]

Allows to see how a document is analyzed against a specific index.

Parameters:
  • index_name (str) – The name of the search index.

  • document (Any) – The document to analyze.

  • options (AnalyzeDocumentSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

The analyzed sections for the document.

Return type:

Deferred[dict[str, Any]]

Raises:

SearchIndexNotFoundException – If the index does not exist.

disallow_querying(index_name: str, options: DisallowQueryingSearchIndexOptions | None = None, **kwargs: Unpack[DisallowQueryingSearchIndexOptionsKwargs]) → Deferred[None]

Disallows querying against an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (DisallowQueryingSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

drop_index(index_name: str, options: DropSearchIndexOptions | None = None, **kwargs: Unpack[DropSearchIndexOptionsKwargs]) → Deferred[None]

Drops an index.

Parameters:
  • index_name (str) – The name of the index.

  • options (DropSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

freeze_plan(index_name: str, options: FreezePlanSearchIndexOptions | None = None, **kwargs: Unpack[FreezePlanSearchIndexOptionsKwargs]) → Deferred[None]

Freezes the assignment of index partitions to nodes for an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (FreezePlanSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

get_all_index_stats(options: GetAllSearchIndexStatsOptions | None = None, **kwargs: Unpack[GetAllSearchIndexStatsOptionsKwargs]) → Deferred[dict[str, Any]]

Retrieves statistics on the search service.

The statistics cover documents, partition indexes, mutations, compactions, queries, and more.

UNCOMMITTED This is an uncommitted API call that is unlikely to change, but may still change as final consensus on its behavior has not yet been reached.

Parameters:
  • options (GetAllSearchIndexStatsOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

The stats report.

Return type:

Deferred[dict[str, Any]]

get_all_indexes(options: GetAllSearchIndexesOptions | None = None, **kwargs: Unpack[GetAllSearchIndexesOptionsKwargs]) → Deferred[Iterable[SearchIndex]]

Fetches all indexes from the server.

Parameters:
  • options (GetAllSearchIndexesOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

A list of all indexes.

Return type:

Deferred[Iterable[SearchIndex]]

get_index(index_name: str, options: GetSearchIndexOptions | None = None, **kwargs: Unpack[GetSearchIndexOptionsKwargs]) → Deferred[SearchIndex]

Fetches an index from the server if it exists.

Parameters:
  • index_name (str) – The name of the search index.

  • options (GetSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

The index definition if it exists.

Return type:

Deferred[SearchIndex]

Raises:

SearchIndexNotFoundException – If the index does not exist.

get_index_stats(index_name: str, options: GetSearchIndexStatsOptions | None = None, **kwargs: Unpack[GetSearchIndexStatsOptionsKwargs]) → Deferred[dict[str, Any]]

Retrieves metrics, timings and counters for a given index.

UNCOMMITTED This is an uncommitted API call that is unlikely to change, but may still change as final consensus on its behavior has not yet been reached.

Parameters:
  • index_name (str) – The name of the search index.

  • options (GetSearchIndexStatsOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

The stats for the index.

Return type:

Deferred[dict[str, Any]]

Raises:

SearchIndexNotFoundException – If the index does not exist.

get_indexed_documents_count(index_name: str, options: GetSearchIndexedDocumentsCountOptions | None = None, **kwargs: Unpack[GetSearchIndexedDocumentsCountOptionsKwargs]) → Deferred[int]

Retrieves the number of documents that have been indexed for an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (GetSearchIndexedDocumentsCountOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

The number of documents indexed for the specified index.

Return type:

Deferred[int]

Raises:

SearchIndexNotFoundException – If the index does not exist.

pause_ingest(index_name: str, options: PauseIngestSearchIndexOptions | None = None, **kwargs: Unpack[PauseIngestSearchIndexOptionsKwargs]) → Deferred[None]

Pauses updates and maintenance for an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (PauseIngestSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

resume_ingest(index_name: str, options: ResumeIngestSearchIndexOptions | None = None, **kwargs: Unpack[ResumeIngestSearchIndexOptionsKwargs]) → Deferred[None]

Resumes updates and maintenance for an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (ResumeIngestSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

unfreeze_plan(index_name: str, options: UnfreezePlanSearchIndexOptions | None = None, **kwargs: Unpack[UnfreezePlanSearchIndexOptionsKwargs]) → Deferred[None]

Unfreezes the assignment of index partitions to nodes for an index.

Parameters:
  • index_name (str) – The name of the search index.

  • options (UnfreezePlanSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

SearchIndexNotFoundException – If the index does not exist.

upsert_index(index: SearchIndex, options: UpsertSearchIndexOptions | None = None, **kwargs: Unpack[UpsertSearchIndexOptionsKwargs]) → Deferred[None]

Creates or updates an index.

Parameters:
  • index (SearchIndex) – The index definition.

  • options (UpsertSearchIndexOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

InvalidArgumentException – If the index definition is invalid.

This module also publishes these, described where they are first documented: