Skip to content

Scalar filtering optimization #38756

Dec 25, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

From v2.4.8, Milvus provides a new feature "clustering key":
https://milvus.io/docs/clustering-compaction.md#Clustering-Compaction

You can define a clustering key in the collection schema:

schema = MilvusClient.create_schema()
schema.add_field(field_name="dummy", datatype=DataType.INT32, is_clustering_key=True)

With this clustering key, data is arranged by the values of the "dummy" field. When you call search(filter="dummy == 8"), the search engine can quickly know which segment contains the data with "dummy == 8", other segments are skipped, to improve the search performance.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@YolandaLyj
Comment options

Answer selected by YolandaLyj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants