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
[ERROR]: pymilvus.exceptions.MilvusException: <MilvusException: (code=1100, message=only IP is the supported metric type for sparse index: invalid parameter[expected=valid index params][actual=invalid index params])>
#2956
Open
1 task done
ubairnisar opened this issue
Dec 30, 2024
· 1 comment
from pymilvus import MilvusClient, DataType, Function, FunctionType
client = MilvusClient(uri="http://192.168.50.69:19530" , db_name="MonteurAIDevAI")
schema = client.create_schema()
analyzer_params={
"type": "standard",
"filter" : ["lowercase"]
}
schema.add_field(field_name="id", datatype=DataType.INT64, is_primary=True, auto_id=True)
schema.add_field(field_name="text", datatype=DataType.VARCHAR, max_length=1000, enable_analyzer=True , analyzer_params=analyzer_params,)
schema.add_field(field_name="sparse", datatype=DataType.SPARSE_FLOAT_VECTOR)
bm25_function = Function(
name="text_bm25_emb", # Function name
input_field_names=["text"], # Name of the VARCHAR field containing raw text data
output_field_names=["sparse"], # Name of the SPARSE_FLOAT_VECTOR field reserved to store generated embeddings
function_type=FunctionType.BM25,
)
schema.add_function(bm25_function)
index_params = client.prepare_index_params()
index_params.add_index(
field_name="sparse",
index_type="SPARSE_INVERTED_INDEX",
metric_type="IP"
)
client.create_collection(
collection_name='table_search',
schema=schema,
index_params=index_params
)
client.insert('table_search', [
{'text': 'information retrieval is a field of study.'},
{'text': 'information retrieval focuses on finding relevant information in large datasets.'},
{'text': 'data mining and information retrieval overlap in research.'},
])
search_params = {
'params': {'drop_ratio_search': 0.2},
}
client.search(
collection_name='table_search',
data=['whats the focus of information retrieval?'],
anns_field='sparse',
limit=3,
search_params=search_params
)
I am trying to do full text search using the tutorial here docs, but i am encountering this error.
Suggestion
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Issue
I am trying to do full text search using the tutorial here docs, but i am encountering this error.
Suggestion
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: