Skip to content

Releases: milvus-io/pymilvus

PyMilvus v2.6.3 Release Notes

31 Oct 06:25
9b0f35d

Choose a tag to compare

Highlights

1. Support for Array of Structs

PyMilvus now supports array of structs data types, allowing you to store and query complex nested data structures.

from pymilvus import MilvusClient, DataType

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

schema = client.create_schema(auto_id=False)
schema.add_field(field_name="id", datatype=DataType.INT64, is_primary=True)
schema.add_field(field_name="vector", datatype=DataType.FLOAT_VECTOR, dim=128)

struct_schema = MilvusClient.create_struct_field_schema()
struct_schema.add_field(field_name="name", datatype=DataType.VARCHAR, max_length=100)
struct_schema.add_field(field_name="age", datatype=DataType.INT64)
struct_schema.add_field(field_name="text", datatype=DataType.VARCHAR, max_length=65535)
struct_schema.add_field(field_name="emb", datatype=DataType.FLOAT_VECTOR, dim=128)
schema.add_field(
    field_name="user_info",
    datatype=DataType.ARRAY,
    element_type=DataType.STRUCT,
    struct_schema=struct_schema,
    max_capacity=1000,
)

client.create_collection(collection_name="users", schema=schema)

data = {
    "id": 1,
    "user_info": [
        {"name": "Alice", "age": 30, "text": "this is alice", "emb": [0.1] * 128},
        {"name": "Bob", "age": 20, "text": "this is bob", "emb": [0.2] * 128},
    ]
    "vector": [0.1] * 128
}

client.insert(collection_name="users", data=[data])

📖 Documentation Array of Structs, Compatible with Milvus 2.6.4+

2. Geometry Data Type Support

Query and search with geographic data using the new Geometry data type.

from pymilvus import MilvusClient, DataType

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

schema = MilvusClient.create_schema()
schema.add_field(field_name="id", datatype=DataType.INT64, is_primary=True)
schema.add_field(field_name="location", datatype=DataType.GEOMETRY, nullable=True)
schema.add_field(field_name="vector", datatype=DataType.FLOAT_VECTOR, dim=128)

client.create_collection(collection_name="geo_coll", schema=schema)

data = [
    {"id": 1, "location": "POINT(116.404 39.915)", "vector": [0.1] * 128},
    {"id": 2, "location": "POINT(-73.935 40.730)", "vector": [0.2] * 128}
]
client.insert(collection_name="locations", data=data)

results = client.query(
    collection_name="locations",
    filter=f'st_dwithin(location, "POINT(116.4 39.9)", 1000.0)',
    output_fields=["id", "location"]
)

📖 Documentation Geometry field, Compatible with Milvus 2.6.4+

3. Insert Primary Key with Auto ID Enabled

You can now insert custom primary keys even when auto_id is enabled, providing more flexibility in data management.

from pymilvus import MilvusClient, DataType

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

schema = MilvusClient.create_schema(auto_id=True)
schema.add_field(field_name="id", datatype=DataType.INT64, is_primary=True, auto_id=True)
schema.add_field(field_name="vector", datatype=DataType.FLOAT_VECTOR, dim=128)

client.create_collection(collection_name="my_collection", schema=schema, properties={"allow_insert_auto_id": "true"})

data = [
    {"id": 100, "vector": [0.1] * 128},
    {"id": 200, "vector": [0.2] * 128}
]
client.insert(collection_name="my_collection", data=data)

📖 Documentation Insert when AutoID is true, Compatible with Milvus 2.6.3+

4. L0 Compaction Support

Trigger L0 compaction manually to optimize storage and query performance.

from pymilvus import MilvusClient

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

client.compact(collection_name="my_collection", is_l0=True)

📖 Documentation Compact L0 segments, Compatible with Milvus 2.6.3+

5. ⚠️ Breaking Change: JSON Serialization for Strings

String values are now treated as JSON-serialized bytes. This is incompatible with previous versions.

Before (2.6.2 and earlier):

client.insert(collection_name="my_collection", data=[{"id": 1, "json_field": "a"}])

Now (2.6.3+):

import json

client.insert(collection_name="my_collection", data=[{"id": 1, "json_field": json.dumps("a")}])

Complete Change Log

Features

  • Struct Support: SDK implementation for struct data type with field-level mmap configuration (#3026, #3037)
  • Geo Data Type: Support for geographic data in insert, query, and search operations (#3043)
  • L0 Compaction: Force L0 compact support (#3011)
  • Function Scorer Ranker: Support using function scorer as ranker (#3010)
  • Replicate Configuration: UpdateReplicateConfiguration API support (#3003)

Enhancements

  • Async Client Improvements: Added retry mechanism and schema cache for AsyncMilvusClient (#3023)
  • Allow user to insert primary key when auto_id is enabled (#3007)
  • Update get_cost_from_status implementation (#3000)
  • Enhanced remote storage usage result info (#3014)
  • Remove annoying logs in MilvusClient (#3016)
  • Raise error when ranker has unknown type (#3021)
  • Support insert serialized JSON (#3031)
  • Cherry pick multiple PRs from master branch (#3048)

Bug Fixes

  • Fix hybrid_search to support EmbeddingList in request data (#3028)

Documentation

  • Add apiKey note for bulk_import (#2997)

Contributors

Special thanks to all contributors who made this release possible:
@SpadeA-Tang, @XuanYang-cn, @aoiasd, @bigsheeper, @chasingegg, @lentitude2tk, @MrPresent-Han, @sunby, @xiaocai2333, @zhuwenxing


For more information, visit the PyMilvus GitHub repository.
Full Changelog: v2.6.2...v2.6.3

PyMilvus v2.6.2 Release Notes

18 Sep 12:27
e9fbd2d

Choose a tag to compare

What's Changed

Full Changelog: v2.6.1...v2.6.2

PyMilvus v2.5.16 Release Notes

19 Sep 06:58
cbac2f3

Choose a tag to compare

What's Changed

Full Changelog: v2.5.15...v2.5.16

PyMilvus v2.6.1 Release Notes

29 Aug 10:03
0237c9f

Choose a tag to compare

What's Changed

Full Changelog: v2.6.0...v2.6.1

PyMilvus v2.5.15 Release Notes

21 Aug 11:30
ac5baf9

Choose a tag to compare

What's Changed

Full Changelog: v2.5.14...v2.5.15

PyMilvus v2.6.0 Release Notes

06 Aug 09:08
1e56ce7

Choose a tag to compare

New Features

  1. Add APIs in MilvusClient
  • enhance: add describe and alter database in MilvusClient by @smellthemoon in #2433
  • enhance: support milvus-client iterator by @MrPresent-Han in #2461
  • enhance: Enable resource group api in milvus client by @weiliu1031 in #2513
  • enhance: add release_collection, drop_index, create_partition, drop_partition, load_partition and release_partition by @brcarry in #2525
  • enhance: enable describe_replica api in milvus client by @weiliu1031 in #2541
  • enhance: support recalls for milvus_client by @chasingegg in #2552
  • enhance: add use_database by @czs007 in #2491
  1. Add AsyncMilvusClient
  1. Other features

New Contributors

Full Changelog: v2.5.0...v2.6.0

PyMilvus 2.5.14 Release Notes

21 Jul 16:18
ee685d4

Choose a tag to compare

What's Changed

Full Changelog: v2.5.13...v2.5.14

PyMilvus 2.5.13 Release Notes

18 Jul 08:02
f6bff15

Choose a tag to compare

What's Changed

Full Changelog: v2.5.12...v2.5.13

PyMilvus 2.5.12 Release Notes

02 Jul 15:33
92df487

Choose a tag to compare

What's Changed

  • fix: [2.5]add retry in compact for compatibility with old Milvus server in order to reduce describecollection by @JsDove in #2842
  • enhance: optimize perf for search&&query under large topk(#2848) by @MrPresent-Han in #2855
  • fix: remove validation for collection_id in manual_compaction method by @JsDove in #2857
  • fix: update manual_compaction method parameter by @JsDove in #2859
  • enhance: [25]fix according to the latest ruff by @XuanYang-cn in #2861
  • fix: hybridExtraList miss iter method and dynamic fields value overrite fixed field value(#2848) by @MrPresent-Han in #2866
  • enhance: make query result mutable for only one time modification(#2848) by @MrPresent-Han in #2871
  • enhance: Cherry pick multiple prs by @XuanYang-cn in #2882

Full Changelog: v2.5.11...V2.5.12

PyMilvus 2.5.11 Release Notes

10 Jun 00:41
d55ee6d

Choose a tag to compare

What's Changed

  • fix:[2.5] wrong marshal field schema prarams case alter collection failed by @aoiasd in #2811
  • Add bulkinsert example for parquet file by @yhmo in #2813
  • fix: [2.5] Pass correct number of params of _prepare_row_upsert_request by @congqixia in #2819
  • enhance: Multiple Cherry picks from master by @XuanYang-cn in #2808
  • fix: [cp25]MilvusClient misusage of disconnect by @XuanYang-cn in #2817
  • enhance: [2.5] Support run analyzer by collection and field by @aoiasd in #2821
  • fix: await on remove async connections by @XuanYang-cn in #2829
  • fix: [cp25]remove calling of deregister_state_change_callback by @XuanYang-cn in #2834
  • enahnce:[2.5] dump analyzer params when init field schema by @aoiasd in #2845

Full Changelog: v2.5.10...v2.5.11