You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
search code:
result=client.query(
collection_name="total_text_image_search",
filter='',
output_fields=['image_id','image_info'],
limit=1,
order_by='image_id',
order ='DESC'
)
if result and len(result)>0:
max_image_id=result[0]['image_id']
max_work_id=result[0]['image_info']['work_id']
but the return value is not the max of the image_id.
Expected Behavior
No response
Steps To Reproduce
Milvus Log
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered:
@tom729 Hello there! I'm here to help you out with any bugs, questions, or contributions you have. Let's tackle this issue together!
The issue you're experiencing might be related to how the order_by and order parameters are functioning in your query. Unfortunately, I couldn't find specific information on the behavior or constraints of these parameters in Milvus v2.5.4. However, here are a few things you might want to check or try:
Ensure Correct Field Usage: Verify that the order_by parameter is correctly set to the field you want to sort by, which in your case is image_id.
Check Data Consistency: Ensure that the data in the image_id field is consistent and correctly indexed. Any inconsistencies might affect the query results.
Query Logic: Double-check the logic of your query to ensure that it is correctly structured to retrieve the maximum value. You might want to test the query with different parameters or a smaller dataset to see if the issue persists.
Milvus Documentation: Review the Milvus documentation for any updates or notes on the order_by and order parameters that might affect their behavior in version v2.5.4.
If these steps don't resolve the issue, consider testing with a different version of Milvus or checking for any updates or patches that might address this behavior.
Is there an existing issue for this?
Environment
Current Behavior
schema.add_field(field_name="image_id", datatype=DataType.INT64, is_primary=True, description="image id")
schema.add_field(field_name="image_info", datatype=DataType.JSON, description="image info")
schema.add_field(field_name="image_url", datatype=DataType.VARCHAR, max_length=500, description="image URL")
schema.add_field(field_name="image_vector", datatype=DataType.FLOAT_VECTOR, dim=512, description="image vector")
#schema.add_field(field_name="summary", datatype=DataType.VARCHAR, max_length=1000, description="work summary")
schema.add_field(field_name="summary_dense_vector", datatype=DataType.FLOAT_VECTOR, dim=1024, description="summary dense vector")
schema.add_field(field_name="summary_sparse_vector", datatype=DataType.SPARSE_FLOAT_VECTOR, description="summary sparse vector")
index_params = client.prepare_index_params()
index_params.add_index(
field_name="image_vector",
index_type="AUTOINDEX",
metric_type="IP",
)
index_params.add_index(
field_name="summary_dense_vector",
index_type="AUTOINDEX",
metric_type="IP",
)
index_params.add_index(
field_name="summary_sparse_vector",
index_type="SPARSE_INVERTED_INDEX",
metric_type="IP",
)
client.create_collection(
collection_name= my_collection_name,
schema=schema,
index_params=index_params,
)
search code:
result=client.query(
collection_name="total_text_image_search",
filter='',
output_fields=['image_id','image_info'],
limit=1,
order_by='image_id',
order ='DESC'
)
if result and len(result)>0:
max_image_id=result[0]['image_id']
max_work_id=result[0]['image_info']['work_id']
but the return value is not the max of the image_id.
Expected Behavior
No response
Steps To Reproduce
Milvus Log
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: