-
Notifications
You must be signed in to change notification settings - Fork 1
/
milvus2_search_test.py
97 lines (81 loc) · 15.7 KB
/
milvus2_search_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# hello_milvus.py demonstrates the basic operations of PyMilvus, a Python SDK of Milvus.
# 1. connect to Milvus
# 2. create collection
# 3. insert data
# 4. create index
# 5. search, query, and hybrid search on entities
# 6. delete entities by PK
# 7. drop collection
import random
import time
from pymilvus import (
connections,
utility,
FieldSchema, CollectionSchema, DataType,
Collection,
)
fmt = "\n=== {:30} ===\n"
search_latency_fmt = "search latency = {:.4f}s"
#################################################################################
# 1. connect to Milvus
# Add a new connection alias `default` for Milvus server in `localhost:19530`
# Actually the "default" alias is a buildin in PyMilvus.
# If the address of Milvus is the same as `localhost:19530`, you can omit all
# parameters and call the method as: `connections.connect()`.
#
# Note: the `using` parameter of the following methods is default to "default".
print(fmt.format("start connecting to Milvus"))
connections.connect("default", host="10.1.37.185", port="19530")
# utility.drop_collection("artifact")
# utility.drop_collection("artifact")
has = utility.has_collection("artifact")
print(f"Does collection artifact exist in Milvus: {has}")
#################################################################################
# 2. create collection
# We're going to create a collection with 3 fields.
# +-+------------+------------+------------------+------------------------------+
# | | field name | field type | other attributes | field description |
# +-+------------+------------+------------------+------------------------------+
# |1| "pk" | Int64 | is_primary=True | "primary field" |
# | | | | auto_id=False | |
# +-+------------+------------+------------------+------------------------------+
# |2| "random" | Double | | "a double field" |
# +-+------------+------------+------------------+------------------------------+
# |3|"embeddings"| FloatVector| dim=8 | "float vector with dim 8" |
# +-+------------+------------+------------------+------------------------------+
fields = [
FieldSchema(name="pk", dtype=DataType.INT64, is_primary=True, auto_id=False),
FieldSchema(name="artifact_type", dtype=DataType.INT64),
FieldSchema(name="embeddings", dtype=DataType.FLOAT_VECTOR, dim=2048)
]
schema = CollectionSchema(fields, "artifact is the simplest demo to introduce the APIs")
print(fmt.format("Create collection `art`"))
artifact = Collection("artifact", schema, consistency_level="Strong")
################################################################################
# 5. search, query, and hybrid search
# After data were inserted into Milvus and indexed, you can perform:
# - search based on vector similarity
# - query based on scalar filtering(boolean, int, etc.)
# - hybrid search based on vector similarity and scalar filtering.
#
# Before conducting a search or a query, you need to load the data in `art` into memory.
print(fmt.format("Start loading"))
artifact.load()
# -----------------------------------------------------------------------------
# query based on scalar filtering(boolean, int, etc.)
print(fmt.format("Start querying with `artifact_type > 2`"))
start_time = time.time()
result = artifact.query(expr="pk in [1,2,38,40]", output_fields=["artifact_type", "embeddings"])
end_time = time.time()
print(f"query result:\n-{result[0]}")
print(f"query result:\n-{result[1]}")
print(f"query result:\n-{result[2]}")
print(f"query result:\n-{result[3]}")
search_params = {
"metric_type": "l2",
"params": {"nprobe": 16},
}
vec = [[0.58, 0.58, 0.66, 0.2, 0.53, 0.68, 0.46, 0.03, 0.05, 0.15, 0.86, 0.99, 0.32, 0.86, 0.94, 0.22, 0.54, 0.72, 0.9, 0.69, 0.87, 0.71, 0.3, 0.97, 0.13, 0.44, 0.68, 0.38, 0.99, 0.55, 0.8, 0.76, 0.65, 0.02, 0.16, 0.29, 0.76, 0.0, 0.68, 0.11, 0.24, 0.52, 0.73, 0.65, 0.52, 0.77, 0.53, 0.55, 0.75, 0.32, 0.62, 0.94, 0.44, 0.55, 0.69, 0.14, 0.01, 0.74, 0.29, 0.48, 0.21, 0.61, 0.37, 0.21, 0.73, 0.7, 0.62, 0.61, 0.09, 0.86, 0.55, 0.18, 0.66, 0.36, 0.35, 0.41, 0.81, 0.36, 0.74, 0.68, 1.0, 0.23, 0.62, 0.44, 0.63, 0.37, 0.1, 0.66, 0.78, 0.71, 0.53, 0.71, 0.85, 0.1, 0.22, 0.37, 0.35, 0.78, 0.44, 0.58, 0.74, 0.12, 0.88, 0.06, 0.38, 0.02, 0.15, 0.55, 0.94, 0.98, 0.22, 0.44, 0.17, 0.93, 0.62, 0.94, 0.85, 0.51, 0.1, 0.59, 0.48, 0.08, 0.07, 0.75, 0.73, 0.68, 0.92, 0.11, 0.21, 0.33, 0.85, 0.05, 0.92, 0.21, 0.65, 0.49, 0.57, 0.4, 0.33, 0.08, 0.72, 0.38, 0.06, 0.17, 0.3, 0.41, 0.16, 0.66, 0.12, 0.23, 0.14, 0.74, 0.55, 0.78, 0.29, 0.01, 0.62, 0.19, 0.08, 0.85, 0.67, 0.06, 0.04, 0.75, 0.43, 0.48, 0.13, 0.59, 0.95, 0.63, 0.04, 0.75, 0.06, 0.0, 0.23, 0.67, 0.63, 0.37, 0.66, 0.56, 0.38, 0.36, 0.94, 0.48, 0.28, 0.88, 0.95, 0.61, 0.53, 0.46, 0.8, 0.41, 0.28, 0.51, 0.41, 0.28, 0.72, 0.3, 0.3, 0.99, 0.69, 0.25, 0.69, 0.69, 0.04, 0.32, 0.6, 0.1, 0.53, 0.86, 0.63, 0.24, 0.18, 0.1, 0.66, 0.95, 0.99, 0.42, 0.2, 0.48, 0.99, 0.63, 0.26, 0.79, 0.98, 0.4, 0.63, 0.1, 0.35, 0.93, 0.3, 0.27, 0.02, 0.26, 0.1, 0.95, 0.89, 0.6, 0.47, 0.45, 0.1, 0.13, 0.46, 0.84, 0.97, 0.48, 0.53, 0.23, 0.08, 0.24, 0.06, 0.04, 0.43, 0.15, 0.58, 0.74, 0.38, 0.82, 0.99, 0.47, 0.74, 0.32, 0.46, 0.2, 0.52, 0.32, 0.97, 0.92, 0.51, 0.2, 0.37, 0.99, 0.8, 0.9, 0.69, 0.49, 0.56, 0.61, 0.83, 0.48, 0.83, 0.4, 0.52, 0.15, 0.76, 0.39, 0.06, 0.88, 0.15, 0.25, 0.18, 0.81, 0.35, 0.28, 0.66, 0.42, 0.92, 0.79, 0.21, 0.56, 0.78, 0.03, 0.18, 0.59, 0.97, 0.54, 0.18, 0.29, 0.99, 0.39, 0.97, 0.74, 0.79, 0.17, 0.97, 0.29, 0.97, 0.98, 0.69, 0.92, 0.64, 0.65, 0.95, 0.65, 0.47, 0.93, 0.15, 0.98, 0.23, 1.0, 0.01, 0.82, 0.4, 0.91, 0.14, 0.09, 0.48, 0.99, 0.33, 0.07, 0.61, 0.58, 0.79, 0.46, 0.55, 0.92, 0.99, 0.73, 0.43, 0.17, 0.56, 0.09, 0.24, 0.01, 0.79, 0.44, 0.07, 0.18, 0.64, 0.29, 0.91, 0.53, 0.83, 0.2, 0.64, 0.65, 0.91, 0.04, 0.06, 0.35, 0.99, 0.9, 0.98, 0.64, 0.1, 0.69, 0.41, 0.04, 0.96, 0.83, 0.8, 0.82, 0.53, 0.04, 0.62, 0.55, 0.18, 0.91, 0.51, 0.79, 0.91, 0.39, 0.64, 0.42, 0.84, 0.55, 0.76, 0.04, 0.87, 0.05, 0.69, 0.68, 0.83, 0.16, 0.14, 0.32, 0.24, 0.07, 0.75, 0.55, 0.63, 0.49, 0.56, 0.66, 0.79, 0.04, 0.07, 0.14, 0.51, 0.05, 0.5, 0.21, 0.09, 0.15, 0.64, 0.2, 0.79, 0.63, 0.78, 0.79, 0.71, 0.08, 0.83, 0.03, 0.09, 0.69, 0.26, 0.32, 0.13, 0.44, 0.62, 0.48, 0.75, 0.25, 0.36, 0.82, 0.53, 0.22, 0.53, 0.9, 0.42, 0.55, 0.15, 0.25, 0.59, 0.33, 0.44, 0.17, 0.42, 0.66, 0.73, 0.34, 0.86, 0.9, 0.87, 0.06, 0.24, 0.67, 0.13, 0.19, 0.39, 0.83, 0.53, 0.75, 0.16, 0.52, 0.1, 0.47, 0.03, 0.45, 0.34, 0.3, 0.82, 0.39, 0.12, 0.25, 0.89, 0.56, 0.03, 0.8, 0.54, 0.92, 0.56, 0.19, 0.25, 0.58, 0.43, 0.29, 0.18, 0.93, 0.62, 0.54, 0.38, 0.46, 0.48, 0.36, 0.32, 0.38, 0.44, 0.65, 0.8, 0.16, 0.29, 0.85, 0.74, 0.7, 0.93, 0.6, 0.28, 0.03, 0.03, 0.03, 0.03, 0.81, 0.51, 0.73, 0.21, 0.96, 0.33, 0.14, 0.88, 0.24, 0.3, 0.19, 0.76, 0.11, 0.42, 0.29, 0.7, 0.01, 0.55, 0.11, 0.18, 0.15, 0.6, 0.79, 0.14, 0.92, 0.56, 0.81, 0.89, 0.65, 0.9, 0.35, 0.96, 0.62, 0.93, 0.38, 0.61, 0.77, 0.18, 0.02, 0.89, 0.78, 0.36, 0.71, 0.12, 0.08, 0.17, 1.0, 0.11, 0.37, 0.1, 0.48, 0.93, 0.89, 0.72, 0.04, 0.18, 0.34, 0.94, 0.29, 0.58, 0.88, 0.54, 0.45, 0.78, 0.83, 0.98, 0.31, 0.87, 0.03, 0.75, 0.27, 0.29, 0.24, 0.25, 0.58, 1.0, 0.19, 0.11, 0.45, 0.28, 0.62, 0.15, 0.97, 0.46, 0.43, 0.95, 0.59, 0.57, 0.33, 0.04, 0.75, 0.32, 0.52, 0.0, 0.59, 0.79, 0.98, 0.8, 0.68, 0.03, 0.22, 0.19, 0.88, 0.92, 0.24, 0.58, 0.85, 0.21, 0.49, 0.63, 0.63, 0.81, 0.91, 0.62, 0.7, 0.05, 0.94, 0.72, 0.19, 0.62, 0.78, 0.88, 0.59, 0.35, 0.29, 0.72, 0.13, 0.88, 0.11, 0.37, 0.36, 0.12, 0.19, 0.55, 0.13, 0.29, 0.73, 0.25, 0.03, 0.45, 0.54, 0.72, 0.52, 0.39, 0.0, 0.31, 0.33, 0.6, 0.98, 0.78, 0.01, 0.35, 0.27, 0.4, 0.65, 0.61, 0.76, 0.38, 0.36, 0.27, 0.62, 0.5, 0.38, 0.11, 0.32, 0.57, 0.95, 0.56, 0.98, 0.07, 0.1, 0.02, 0.59, 0.38, 0.04, 0.05, 0.02, 0.19, 0.3, 0.56, 0.71, 0.67, 0.93, 0.77, 0.75, 0.96, 0.32, 0.33, 0.94, 0.43, 0.28, 1.0, 0.33, 0.88, 0.47, 0.32, 0.52, 0.97, 0.29, 0.07, 0.78, 0.24, 0.95, 0.66, 0.12, 0.16, 0.35, 0.89, 0.53, 0.03, 0.79, 0.53, 0.58, 0.83, 0.93, 0.15, 0.94, 0.35, 0.29, 0.05, 0.21, 0.62, 0.84, 0.44, 0.75, 0.47, 0.74, 0.37, 0.17, 0.47, 0.15, 0.85, 0.77, 0.91, 0.49, 0.58, 0.03, 0.01, 0.6, 0.25, 0.6, 0.6, 0.2, 0.28, 0.86, 0.56, 0.62, 0.73, 0.19, 0.28, 0.53, 0.57, 0.44, 0.26, 0.25, 0.55, 0.64, 0.91, 0.65, 0.18, 0.24, 0.06, 0.39, 0.67, 0.91, 0.23, 0.23, 0.46, 0.25, 0.02, 0.68, 0.37, 0.62, 0.48, 0.87, 0.82, 0.36, 0.06, 0.85, 0.4, 0.39, 0.79, 0.74, 0.67, 0.23, 0.77, 0.92, 0.8, 0.12, 0.17, 0.27, 0.49, 0.5, 1.0, 0.42, 0.45, 0.32, 0.37, 0.6, 0.48, 0.55, 0.82, 0.03, 0.33, 0.73, 0.62, 0.89, 0.71, 0.46, 0.44, 0.61, 0.09, 0.09, 0.64, 0.63, 0.68, 0.46, 0.94, 0.52, 0.32, 0.17, 0.3, 0.28, 0.04, 0.03, 0.57, 0.21, 0.72, 0.47, 0.98, 0.54, 0.36, 0.78, 0.34, 0.93, 0.29, 0.3, 0.95, 0.54, 0.32, 0.43, 0.2, 0.63, 0.69, 0.91, 0.77, 0.7, 0.32, 0.02, 0.23, 0.95, 0.73, 0.66, 0.55, 0.08, 0.42, 0.23, 0.51, 0.91, 0.42, 0.18, 0.13, 0.14, 0.14, 0.14, 0.05, 0.81, 0.97, 0.43, 0.94, 0.38, 1.0, 0.51, 0.88, 0.3, 0.36, 0.12, 0.49, 0.59, 0.06, 0.5, 0.5, 0.55, 0.58, 0.8, 0.17, 0.57, 0.62, 0.38, 0.48, 0.81, 0.18, 0.25, 0.11, 0.06, 0.45, 0.81, 0.65, 0.45, 0.01, 0.63, 0.6, 0.2, 0.85, 0.95, 0.37, 0.61, 0.22, 0.54, 0.31, 0.25, 0.51, 0.56, 0.73, 0.47, 0.52, 0.14, 0.83, 0.66, 0.4, 0.68, 0.38, 0.51, 0.22, 0.09, 0.79, 0.3, 0.14, 0.67, 0.81, 0.35, 0.63, 0.12, 0.7, 0.23, 0.65, 0.85, 0.43, 0.11, 0.94, 0.3, 0.71, 0.6, 0.97, 0.67, 0.93, 0.28, 0.27, 0.65, 0.41, 0.72, 0.76, 0.17, 0.57, 0.08, 0.53, 0.38, 0.7, 0.75, 0.02, 0.68, 0.92, 0.51, 0.81, 0.64, 0.06, 0.37, 0.87, 0.85, 0.11, 0.3, 0.6, 0.88, 0.71, 0.4, 0.76, 0.16, 0.9, 0.52, 0.89, 0.5, 0.15, 0.6, 0.07, 0.29, 0.15, 0.38, 0.86, 0.6, 0.01, 0.32, 0.23, 0.3, 0.03, 0.36, 0.25, 0.87, 0.96, 0.69, 0.13, 0.15, 0.4, 0.79, 0.54, 0.43, 0.69, 0.1, 0.28, 0.5, 0.49, 0.26, 0.76, 0.7, 0.87, 0.49, 0.4, 0.84, 0.43, 0.13, 0.37, 0.52, 0.18, 0.37, 0.51, 0.98, 0.85, 0.89, 0.83, 0.66, 0.3, 0.17, 0.88, 0.14, 0.51, 0.6, 0.19, 0.59, 0.53, 0.59, 0.01, 0.96, 0.37, 0.78, 0.77, 0.46, 0.37, 0.09, 0.49, 0.86, 0.51, 0.39, 0.11, 0.99, 0.8, 0.55, 0.51, 0.39, 0.72, 0.95, 0.14, 0.19, 1.0, 0.04, 0.84, 0.85, 0.51, 0.99, 0.28, 0.6, 0.54, 0.83, 0.17, 0.31, 0.33, 0.01, 0.12, 0.97, 0.99, 0.63, 0.54, 0.05, 0.32, 1.0, 0.22, 0.23, 0.43, 0.73, 0.03, 0.07, 0.47, 0.58, 0.95, 0.67, 0.23, 0.06, 0.27, 0.3, 0.17, 0.49, 0.45, 0.33, 0.29, 0.99, 0.87, 0.38, 0.77, 0.08, 0.61, 0.88, 0.01, 0.89, 0.04, 0.71, 0.78, 0.77, 0.2, 0.98, 0.04, 0.93, 0.03, 0.73, 0.97, 0.43, 0.99, 0.97, 0.65, 0.66, 0.74, 0.32, 0.38, 0.63, 0.27, 0.54, 0.42, 0.61, 0.44, 0.53, 0.8, 0.11, 0.71, 0.59, 0.89, 0.61, 0.4, 0.7, 0.95, 0.22, 0.63, 0.13, 0.98, 0.57, 0.81, 0.49, 0.19, 0.62, 0.27, 0.55, 0.42, 0.69, 0.9, 0.54, 0.45, 0.74, 0.73, 0.64, 0.77, 0.04, 0.91, 0.97, 0.68, 0.5, 0.45, 0.42, 0.94, 0.82, 0.53, 0.78, 0.45, 0.7, 0.53, 0.83, 0.62, 0.78, 0.28, 0.41, 0.55, 0.99, 0.98, 0.14, 0.76, 0.0, 0.96, 0.17, 0.73, 0.9, 0.42, 0.97, 0.85, 0.46, 0.28, 0.73, 0.37, 0.74, 0.41, 0.68, 0.13, 0.98, 0.85, 0.98, 0.14, 0.81, 0.21, 0.24, 0.85, 0.24, 0.21, 0.56, 0.92, 0.93, 0.94, 0.71, 0.4, 0.09, 0.87, 0.72, 0.39, 0.16, 0.53, 0.82, 0.12, 0.69, 0.46, 0.03, 0.72, 0.83, 0.33, 0.37, 0.37, 0.09, 0.06, 0.14, 0.28, 0.08, 0.72, 0.04, 0.89, 0.43, 0.74, 0.22, 0.57, 0.82, 0.68, 0.93, 0.67, 0.53, 0.34, 0.9, 0.44, 0.56, 0.14, 0.4, 0.0, 0.72, 0.97, 0.11, 0.43, 0.57, 0.59, 0.08, 0.69, 0.51, 0.97, 0.17, 0.72, 0.59, 0.09, 0.83, 0.87, 0.95, 0.37, 0.82, 0.92, 0.63, 0.64, 0.24, 0.72, 0.59, 0.89, 0.2, 0.85, 0.92, 0.11, 0.95, 0.29, 0.65, 0.51, 0.93, 0.6, 0.46, 0.83, 0.03, 0.05, 0.46, 0.74, 0.97, 0.22, 0.33, 0.16, 1.0, 0.95, 0.05, 0.53, 0.63, 0.7, 0.59, 0.73, 0.39, 0.06, 0.58, 0.25, 0.7, 0.43, 0.26, 0.32, 0.12, 0.93, 0.23, 0.43, 0.18, 0.05, 0.88, 0.53, 0.72, 0.7, 0.71, 0.88, 0.61, 0.28, 0.87, 0.45, 0.94, 0.43, 0.16, 0.16, 0.86, 0.51, 0.05, 0.03, 0.92, 0.31, 0.1, 0.62, 0.65, 0.98, 0.23, 0.66, 0.9, 0.31, 0.52, 0.43, 0.35, 0.83, 0.11, 0.09, 0.81, 0.83, 0.34, 0.46, 0.63, 0.74, 0.55, 0.6, 0.95, 0.49, 0.04, 0.42, 0.24, 0.54, 0.6, 0.12, 0.98, 0.12, 0.55, 0.34, 0.21, 0.51, 0.02, 0.29, 0.15, 0.47, 0.21, 0.68, 0.18, 0.45, 0.55, 0.98, 0.98, 0.87, 0.64, 0.22, 0.86, 0.28, 1.0, 0.09, 0.51, 0.87, 0.14, 0.5, 0.34, 0.72, 0.02, 0.24, 0.77, 0.33, 0.67, 0.92, 0.89, 0.61, 0.6, 0.03, 0.89, 0.23, 0.69, 0.78, 0.19, 1.0, 0.86, 0.16, 0.34, 0.56, 0.24, 0.98, 0.96, 0.65, 0.26, 0.3, 0.08, 0.54, 0.49, 0.86, 0.94, 0.44, 0.54, 0.09, 0.71, 0.9, 0.37, 0.68, 0.05, 0.06, 0.86, 0.74, 0.32, 0.05, 0.94, 0.77, 0.96, 0.51, 0.35, 0.91, 0.82, 0.11, 0.64, 0.59, 0.63, 0.05, 0.46, 0.44, 0.57, 0.58, 0.54, 0.38, 0.35, 0.9, 0.68, 0.82, 0.73, 0.39, 0.18, 0.34, 0.47, 0.39, 0.72, 0.24, 0.54, 0.01, 0.94, 0.99, 0.43, 0.48, 0.3, 0.58, 0.48, 0.29, 0.77, 0.69, 0.34, 0.19, 0.07, 0.08, 0.36, 0.12, 0.86, 0.94, 0.26, 0.95, 0.61, 0.1, 0.29, 0.43, 0.49, 0.86, 0.33, 0.59, 0.7, 0.62, 0.59, 0.3, 0.6, 0.52, 0.87, 0.26, 0.78, 0.28, 0.65, 0.28, 0.27, 0.89, 0.38, 0.73, 0.48, 0.88, 0.6, 0.12, 0.04, 0.03, 0.2, 0.66, 0.8, 0.91, 0.27, 0.53, 0.08, 0.58, 0.83, 0.45, 0.91, 0.25, 0.99, 0.18, 0.88, 0.71, 0.17, 0.76, 0.55, 0.19, 0.87, 0.97, 0.14, 0.58, 0.81, 0.81, 0.09, 0.34, 0.61, 0.34, 0.81, 0.27, 0.7, 0.81, 0.18, 0.48, 0.87, 0.68, 0.69, 0.67, 0.92, 0.63, 0.97, 0.72, 0.49, 0.74, 0.26, 0.79, 0.26, 0.92, 0.78, 0.08, 0.64, 0.03, 0.63, 0.21, 0.47, 0.28, 0.96, 0.69, 0.27, 0.16, 0.98, 0.92, 0.18, 0.29, 0.59, 0.54, 0.89, 0.58, 0.18, 0.95, 0.99, 0.45, 0.07, 0.24, 0.86, 0.45, 0.22, 0.38, 0.24, 0.88, 0.56, 0.94, 0.38, 0.55, 0.44, 0.34, 0.66, 0.11, 0.46, 0.21, 0.02, 0.71, 0.02, 0.05, 0.07, 0.57, 0.57, 0.49, 0.87, 0.66, 0.94, 0.48, 0.62, 0.91, 0.89, 0.96, 0.47, 0.14, 0.08, 0.37, 0.91, 0.63, 0.92, 0.55, 0.78, 0.44, 0.99, 0.99, 0.99, 0.53, 0.83, 0.14, 0.82, 0.1, 0.46, 0.85, 0.03, 0.4, 0.9, 0.16, 0.82, 0.33, 0.07, 0.49, 0.64, 0.99, 0.27, 0.36, 0.74, 0.19, 0.19, 0.27, 0.9, 0.51, 0.04, 0.28, 0.47, 0.63, 0.02, 0.68, 0.99, 0.1, 0.04, 0.65, 0.06, 0.25, 0.72, 0.87, 0.36, 0.62, 0.99, 0.44, 0.7, 0.69, 0.88, 0.07, 0.74, 0.01, 0.93, 0.39, 0.18, 0.06, 0.61, 0.17, 0.41, 0.27, 0.14, 0.0, 0.44, 0.67, 0.49, 0.12, 0.26, 0.23, 0.54, 0.07, 0.27, 0.59, 0.18, 0.26, 0.72, 0.16, 0.71, 0.41, 0.74, 0.23, 0.09, 0.7, 0.78, 0.31, 0.39, 0.75, 0.78, 0.06, 0.22, 0.94, 0.23, 0.63, 0.1, 0.88, 1.0, 0.49, 0.28, 0.35, 0.46, 0.28, 0.5, 0.69, 0.36, 0.57, 0.39, 0.96, 0.19, 0.67, 0.25, 0.61, 0.02, 0.8, 0.66, 0.09, 0.36, 0.28, 0.07, 0.92, 0.86, 0.48, 0.86, 0.66, 0.65, 0.18, 0.62, 0.62, 0.57, 0.48, 0.85, 0.16, 0.9, 0.11, 0.76, 0.73, 0.66, 0.51, 0.99, 0.11, 0.88, 0.72, 0.84, 0.41, 0.75, 0.39, 0.5, 0.44, 0.29, 0.91, 0.57, 0.94, 0.72, 0.66, 0.54, 0.28, 0.43, 0.62, 0.77, 0.17, 0.55, 0.23, 0.12, 0.39, 0.28, 0.09, 0.7, 0.16, 0.62, 0.82, 0.26, 0.74, 0.06, 0.57, 0.24, 0.37, 0.14, 0.46, 0.68, 0.85, 0.39, 0.7, 0.81, 0.23, 0.56, 0.15, 0.82, 0.47, 0.88, 0.52, 0.05, 0.53, 0.7, 0.61, 0.33, 0.15, 0.59, 0.31, 0.64, 0.04, 0.27, 0.6, 0.39, 0.93, 0.29, 0.55, 0.79, 0.19, 0.71, 0.49, 0.69, 0.5, 0.53, 0.04, 0.38, 0.8, 0.06, 0.62, 0.23, 0.78, 0.58, 0.76, 0.94, 0.95, 0.71, 0.93, 0.24, 0.26, 0.04, 0.89, 0.6, 0.85, 0.78, 0.8, 0.77, 0.2, 0.18, 0.79, 0.77, 0.88, 0.33, 0.79, 0.01, 0.89, 0.81, 0.75, 0.17, 0.23, 0.59, 0.81, 0.5, 0.38, 0.12, 0.81, 0.34, 0.41, 0.26, 0.15, 1.0, 0.75, 0.27, 0.38, 0.86, 0.79, 0.92, 0.26, 0.9, 0.58, 0.37, 0.86, 0.68, 0.45, 0.35, 0.22, 0.0, 0.21, 0.1, 0.23, 0.37, 0.14, 0.9, 0.07, 0.76, 0.02, 0.7, 0.1, 0.07, 0.87, 0.55, 0.22, 0.29, 0.49, 0.45, 0.91, 0.87, 0.8, 0.91, 0.27, 0.41, 0.16, 0.54, 0.57, 0.01, 0.46, 0.3, 0.74, 0.01, 0.24, 0.57, 0.89, 0.89, 0.96, 0.35, 0.11, 0.32, 0.73, 0.31, 0.75, 0.65, 0.72, 0.29, 0.17, 0.71, 0.06, 0.59, 0.21, 0.29, 0.68, 0.04, 0.67, 0.38, 0.69, 0.34, 0.65, 0.29, 0.27, 0.8, 0.53, 0.13, 0.62, 0.3, 0.09, 0.44, 0.06, 0.92, 0.73, 0.86, 0.88, 0.62, 0.43, 0.29, 0.06, 0.06, 0.53, 0.64, 0.52, 0.33, 0.04, 0.38, 0.2, 0.65, 0.94, 0.96, 0.06, 0.41, 0.04, 0.65, 0.74, 0.43, 0.92, 0.15, 0.09, 0.95]]
result = artifact.search(vec, "embeddings", search_params, limit=10, expr="artifact_type > 3", output_fields=["artifact_type"])
print(f"query result:\n-{result[0]}")
print(search_latency_fmt.format(end_time - start_time))