Hippo supports specifying multiple tables with similar schema and performing vector similarity search on these tables.
curl -u shiva:shiva -XGET 'localhost:8902/hippo/v1/{patterns}/_multi_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.3, 0.4] ],
"round_decimal": 2,
"only_explain" : false
}';
With "patterns" keyword in the API, users can set multiple match patterns, thus Hippo will find all target tables and return the final "topk".
{
"num_queries" : 2,
"top_k" : 3,
"results" : [
{
"query" : 0,
"fields_data" : [
{
"field_name" : "book_id",
"field_values" : [
1,
1,
1
]
}
],
"scores" : [
1.45,
1.45,
1.45
],
"tables" : [
"default#table2@3159b79a0ab24f1bb252352a7649f498",
"default#table1@f761f841222f4b26ac8da6aad4a99878",
"default#table3@5424849810174b55b6b8706e3ffba17c"
]
},
{
"query" : 1,
"fields_data" : [
{
"field_name" : "book_id",
"field_values" : [
1,
1,
1
]
}
],
"scores" : [
0.85,
0.85,
0.85
],
"tables" : [
"default#table2@3159b79a0ab24f1bb252352a7649f498",
"default#table1@f761f841222f4b26ac8da6aad4a99878",
"default#table3@5424849810174b55b6b8706e3ffba17c"
]
}
]
}
From returned result, users can get "tables" representing the table in which each data record resides.