After vector is activated, users can perform vector search. The example is shown below:
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": {
"ef_search": 10
},
"embedding_index": "sparse_index"
},
"sparse_vectors": [ ["1:1", "1:1"], ["2:1", "3:1"] ],
"round_decimal": 2,
"only_explain" : false
}';
Result:
{
"num_queries" : 2,
"top_k" : 2,
"results" : [
{
"query" : 0,
"fields_data" : [
{
"field_name" : "book_id",
"field_values" : [
100,
99
]
}
],
"scores" : [
100.0,
99.0
]
},
{
"query" : 1,
"fields_data" : [
{
"field_name" : "book_id",
"field_values" : [
3,
2
]
}
],
"scores" : [
1.0,
1.0
]
}
]
}