After vector is activated, users can perform vector search:
curl -u shiva:shiva -XGET 'localhost:8902/hippo/v1/{table}/_search?pretty' -H 'Content-Type: application/json' -d'{
"output_fields": ["book_id"],
"search_params": {
"anns_field": "book_intro",
"topk": 2,
"params": {
"nprobe": 10
},
"embedding_index": "ivf_flat_index"
},
"vectors": [ [[0.1,0.2],[0.1,0.2]], [[0.3, 0.4],[0.3, 0.4]] ],
"only_explain" : false
}';
Result:
{
"num_queries" : 2,
"top_k" : 2,
"results" : [
{
"query" : 0,
"fields_data" : [
{
"field_name" : "book_id",
"field_values" : [
1,
2
]
}
],
"scores" : [
2.9,
8.5
]
},
{
"query" : 1,
"fields_data" : [
{
"field_name" : "book_id",
"field_values" : [
1,
2
]
}
],
"scores" : [
1.7,
6.5
]
}
]
}