Skip to content

Fulltext

ChromaDB implementation of fulltext search and CRUD capability.

This module provides a ChromaDB implementation of the FulltextCapability protocol using ChromaDB's text search capabilities.

ChromaFulltextCapability(collection_name, client, num_candidates=DEFAULT_NUM_CANDIDATES, encryption=None, default_batch_size=None)

Bases: BaseFulltextCapability

ChromaDB implementation of FulltextCapability protocol.

This class provides document CRUD operations and text search using ChromaDB.

Attributes:

Name Type Description
collection_name str

The name of the ChromaDB collection.

client ClientAPI

ChromaDB client instance.

collection

ChromaDB collection instance.

num_candidates int

Maximum number of candidates to consider during search.

Initialize the ChromaDB fulltext capability.

Parameters:

Name Type Description Default
collection_name str

The name of the ChromaDB collection.

required
client ClientAPI

ChromaDB client instance.

required
num_candidates int

Maximum number of candidates to consider during search. Defaults to DEFAULT_NUM_CANDIDATES.

DEFAULT_NUM_CANDIDATES
encryption EncryptionCapability | None

Encryption capability for field-level encryption. Defaults to None.

None
default_batch_size int | None

Default batch size for batching operations. Defaults to None.

None

get_size()

Returns the total number of documents in the collection.

Returns:

Name Type Description
int int

The total number of documents.