20 lines
542 B
Python
20 lines
542 B
Python
from doris_vector_search import DorisVectorClient, AuthOptions
|
|
|
|
auth = AuthOptions(
|
|
host="192.168.1.242",
|
|
query_port=9030,
|
|
user="thebears",
|
|
password="marybear",
|
|
)
|
|
|
|
client = DorisVectorClient(database="nuggets", auth_options=auth)
|
|
|
|
tbl = client.open_table("video_embeddings")
|
|
|
|
query = [0.1] * 1152 # Example 128-dimensional vector
|
|
|
|
# SELECT id FROM sift_1M ORDER BY l2_distance_approximate(embedding, query) LIMIT 10;
|
|
result = tbl.search(query, metric_type="inner_product").limit(10).select(["id"]).to_pandas()
|
|
|
|
print(result)
|