Skip to content

Cannot get prefix search to work on a scalar text field #35531

Discussion options

You must be logged in to vote

Array field might be the proper solution.

Define the "channels" as Array type field, you can use ARRAY_CONTAINS/ARRAY_CONTAINS_ANY/ARRAY_CONTAINS_ALL to filter its elements.

An example:
**
import random

from pymilvus import (
MilvusClient, DataType,
)

client = MilvusClient(uri="http://localhost:19530")
print(client.list_collections())

collection_name = "AAA"

schema = client.create_schema(enable_dynamic_field=False)
schema.add_field("id", DataType.VARCHAR, is_primary=True, auto_id=False, max_length=65535)
schema.add_field("vector", DataType.FLOAT_VECTOR, dim=128)
schema.add_field("tag", DataType.VARCHAR, max_length=65535, is_partition_key=True)
schema.add_field(field_name="channels", datat…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by juanreynolds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants