Skip to content

Fulltext

Milvus implementation of fulltext search and CRUD capability.

This module provides a Milvus implementation of the FulltextCapability protocol for basic text-based CRUD operations and filtering.

MilvusFulltextCapability(collection_name, client, uri, query_field='content', id_max_length=100, content_max_length=65535, encryption=None, default_batch_size=None)

Bases: BaseFulltextCapability

Milvus implementation of FulltextCapability protocol.

This class provides document CRUD operations and filtering using Milvus. Encryption and batching are handled by the base class.

Attributes:

Name Type Description
collection_name str

The name of the Milvus collection.

client AsyncMilvusClient

Async Milvus client instance.

query_field str

The field name to use for text content.

Initialize the Milvus fulltext capability.

Parameters:

Name Type Description Default
collection_name str

The name of the Milvus collection.

required
client AsyncMilvusClient

The async Milvus client instance.

required
uri str

Milvus URI for creating sync client to prepare index params.

required
query_field str

The field name to use for text content. Defaults to "content".

'content'
id_max_length int

Maximum length for ID field. Defaults to 100.

100
content_max_length int

Maximum length for content field. Defaults to 65535.

65535
encryption EncryptionCapability | None

Encryption capability. Defaults to None.

None
default_batch_size int | None

Default batch size for create/update/delete. Defaults to None.

None

ensure_index() async

Ensure collection exists with proper schema for fulltext capability.

This method is idempotent - if the collection already exists, it will skip creation and return early.

Raises:

Type Description
RuntimeError

If collection creation fails.