Optimizing Search Speed for Vector Similarity in a Filtered Collection Schema #34503
Answered
by
yhmo
JaeHyeonSoon
asked this question in
Q&A and General discussion
-
Hello, fields = [
FieldSchema(name="id", dtype=DataType.INT64, is_primary=True),
FieldSchema(name="text", dtype=DataType.VARCHAR, max_length=512),
FieldSchema(name="word", dtype=DataType.VARCHAR, max_length=512),
FieldSchema(name="tag", dtype=DataType.VARCHAR, max_length=16),
FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=768)
]
schema = CollectionSchema(fields) I want to filter by word == "apple" and calculate the vector similarity among the filtered data to retrieve the tag values of the top 10 most similar data points. How can I optimize the search speed for this task? Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
yhmo
Jul 9, 2024
Replies: 1 comment
-
Set "word" to be partition key: https://milvus.io/docs/use-partition-key.md#Use-Partition-Key |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
JaeHyeonSoon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Set "word" to be partition key: https://milvus.io/docs/use-partition-key.md#Use-Partition-Key