Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Environment
- Milvus version: master-20250305-be4d0956-amd64
- Deployment mode(standalone or cluster):both
- MQ type(rocksmq, pulsar or kafka): all
- SDK version(e.g. pymilvus v2.0.0rc2):2.6.0rc83
- OS(Ubuntu or CentOS):
- CPU/Memory:
- GPU:
- Others:
Current Behavior
The json index name is field name + "/" rather than field name when the json path is just json field name
'my_json/' -> 'my_json'
index_params.add_index(field_name="my_json", index_type="INVERTED", params={"json_cast_type": DataType.INT64, "json_path": "my_json"})
>>> index_list = client.list_indexes(collection_name=collection_name)
>>> index_list
['my_vector', 'my_json/']
Expected Behavior
The json index name is the field name when the json path is just json field name
Steps To Reproduce
from pymilvus import MilvusClient, DataType
import numpy as np
import random
from loguru import logger
client = MilvusClient()
logger.info("connected")
dim=128
nb = 3000
logger.info("creating index params")
schema = client.create_schema(enable_dynamic_field=False)
schema.add_field(field_name="my_id", datatype=DataType.INT64, is_primary=True)
schema.add_field(field_name="my_vector", datatype=DataType.FLOAT_VECTOR, dim=128)
schema.add_field(field_name="my_varchar", datatype=DataType.VARCHAR, max_length=512)
schema.add_field(field_name="my_json", datatype=DataType.JSON)
logger.info("created schema")
logger.info(schema)
collection_name = "customized_setup_102"
logger.info("preparing index params")
index_params = client.prepare_index_params()
index_params.add_index(field_name="my_vector", index_type="AUTOINDEX", metric_type="COSINE")
index_params.add_index(field_name="my_json", index_type="INVERTED", params={"json_cast_type": DataType.INT64, "json_path": "my_json"})
logger.info("prepared index params")
logger.info("creating collection")
client.create_collection(collection_name=collection_name, schema=schema, index_params=index_params)
logger.info("created collection")
index_list = client.list_indexes(collection_name=collection_name)
logger.info(index_list)
Milvus Log
Anything else?
No response