From 3e79b4d9cb8575bca7ad4fee7c5e1cec6b0844a3 Mon Sep 17 00:00:00 2001 From: gsilvestrin Date: Wed, 19 Apr 2023 20:33:23 -0700 Subject: [PATCH] review comments --- docs/src/ann_indexes.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/src/ann_indexes.md b/docs/src/ann_indexes.md index 6d81d33e..96b93e2b 100644 --- a/docs/src/ann_indexes.md +++ b/docs/src/ann_indexes.md @@ -58,3 +58,23 @@ tbl.search(np.random.random((768))) \ ``` The search will return the data requested in addition to the score of each item. The score is the distance between the query vector and the element. A lower number means that the result is more relevant. + +### Filtering (where clause) + +You can further filter the elements returned by a search using a where clause. + +```python +tbl.search(np.random.random((768))).where("item != 'item 1141'").to_df() +``` + +### Projections (select clause) + +You can select the columns returned by the query using a select clause. + +```python +tbl.search(np.random.random((768))).select(["vector"]).to_df() + vector score +0 [0.30928212, 0.022668175, 0.1756372, 0.4911822... 93.971092 +1 [0.2525465, 0.01723831, 0.261568, 0.002007689,... 95.173485 +... +```