release-v0.1.6
ObVecClient::get support filter now, for example
test_collection_name = "ob_delete_get_test"
self.client.drop_table_if_exist(test_collection_name)
cols = [
Column("id", String(64), primary_key=True, autoincrement=False),
Column("embedding", VECTOR(3)),
Column("meta", JSON),
]
self.client.create_table(
test_collection_name, columns=cols
)
# create vector index
self.client.create_index(
test_collection_name,
is_vec_index=True,
index_name="vidx",
column_names=["embedding"],
vidx_params="distance=l2, type=hnsw, lib=vsag",
)
# insert data
data = [
{"id":"abc", "embedding":[0.748479, 0.276979, 0.555195], "meta": {"page": 1}},
{"id":"bcd", "embedding":[0.748479, 0.276979, 0.555195], "meta": {"page": 2}},
{"id":"cde", "embedding":[0, 0, 0], "meta": {"page": 3}},
{"id":"def", "embedding":[1, 2, 3], "meta": {"page": 4}},
]
self.client.insert(test_collection_name, data=data)
self.client.delete(test_collection_name, ids=["bcd", "def"])
res = self.client.get(
test_collection_name,
ids=["abc", "bcd", "cde", "def"],
where_clause=[text("meta->'$.page' > 1")],
output_column_name=['id']
)
Full Changelog: release-v0.1.5...release-v0.1.6