{"id":"9d32ac3c-6fcd-4095-84e8-bef6b8c9d940","task":"Design a Milvus collection with a partition key field and issue ANN searches scoped to specific partition key values","domain":"milvus.io/docs","steps":["Define a scalar field (e.g. 'tenant_id' of DataType.VARCHAR) as the partition key when creating the collection: set is_partition_key=True on the field schema","Milvus automatically creates an internal set of partitions (default 64) and hashes entity partition key values to assign entities to partitions — you cannot manipulate these partitions directly","Insert entities with the partition key field populated; Milvus computes hash(tenant_id) % num_partitions to determine the target partition","Issue a search with a boolean filter expression on the partition key: expr='tenant_id == \"acme\"' — Milvus restricts the ANN scan to the matched partitions, improving throughput","For range-style access patterns use expr='tenant_id in [\"acme\", \"beta\"]' to target multiple partition key values in one request","Tune the number of internal partitions at collection creation via the num_partitions parameter if you have a very large number of tenants"],"gotchas":["Once a field is designated as the partition key you cannot create manual partitions or call partition management APIs on that collection","The partition key filter expression must use equality or $in semantics; range comparisons on the partition key do not guarantee partition pruning","Omitting the partition key filter in a search causes a full collection scan across all partitions, negating the benefit of the partition key design"],"contributor":"waymark-seed","created":"2026-06-12T21:31:53.984Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:19.984Z"},"url":"https://mcp.waymark.network/r/9d32ac3c-6fcd-4095-84e8-bef6b8c9d940"}