Skip to content

Commit 793e991

Browse files
authored
refactor: remove with_vector from query APIs (#338)
1 parent 2ea7420 commit 793e991

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

openviking/storage/vectordb_adapters/base.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ def query(
325325
limit: int = 10,
326326
offset: int = 0,
327327
output_fields: Optional[list[str]] = None,
328-
with_vector: bool = False,
329328
order_by: Optional[str] = None,
330329
order_desc: bool = False,
331330
) -> list[Dict[str, Any]]:
@@ -367,9 +366,6 @@ def query(
367366
record["id"] = item.id
368367
record["_score"] = item.score if item.score is not None else 0.0
369368
record = self._normalize_record_for_read(record)
370-
if not with_vector:
371-
record.pop("vector", None)
372-
record.pop("sparse_vector", None)
373369
records.append(record)
374370
return records
375371

@@ -383,7 +379,7 @@ def delete(
383379
coll = self.get_collection()
384380
delete_ids = list(ids or [])
385381
if not delete_ids and filter is not None:
386-
matched = self.query(filter=filter, limit=limit, with_vector=True)
382+
matched = self.query(filter=filter, limit=limit)
387383
delete_ids = [record["id"] for record in matched if record.get("id")]
388384

389385
if not delete_ids:

openviking/storage/viking_vector_index_backend.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ async def query(
200200
limit: int = 10,
201201
offset: int = 0,
202202
output_fields: Optional[List[str]] = None,
203-
with_vector: bool = False,
204203
order_by: Optional[str] = None,
205204
order_desc: bool = False,
206205
) -> List[Dict[str, Any]]:
@@ -212,7 +211,6 @@ async def query(
212211
limit=limit,
213212
offset=offset,
214213
output_fields=output_fields,
215-
with_vector=with_vector,
216214
order_by=order_by,
217215
order_desc=order_desc,
218216
)
@@ -228,7 +226,6 @@ async def search(
228226
limit: int = 10,
229227
offset: int = 0,
230228
output_fields: Optional[List[str]] = None,
231-
with_vector: bool = False,
232229
) -> List[Dict[str, Any]]:
233230
# Backward-compatible alias for internal call sites.
234231
return await self.query(
@@ -238,7 +235,6 @@ async def search(
238235
limit=limit,
239236
offset=offset,
240237
output_fields=output_fields,
241-
with_vector=with_vector,
242238
)
243239

244240
async def filter(

0 commit comments

Comments
 (0)