Skip to content

Commit 244352b

Browse files
author
Robert Lee
committed
update docs
1 parent 239a242 commit 244352b

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

articles/search/vector-search-filters.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -58,34 +58,33 @@ Filters determine the scope of vector queries and are defined using [Documents -
5858
This REST API provides:
5959

6060
+ `filter` for the criteria.
61-
+ `vectorFilterMode` for pre-query or post-query filtering. For supported modes, see the [next section](#set-the-filter-mode).
61+
+ `vectorFilterMode` to specify when the filter should be applied during the query. For supported modes, see the next section.
6262

6363
```http
6464
POST https://{search-endpoint}/indexes/{index-name}/docs/search?api-version={api-version}
6565
Content-Type: application/json
6666
api-key: {admin-api-key}
6767
68-
{
69-
"count": true,
70-
"select": "title, content, category",
71-
"filter": "category eq 'Databases'",
72-
"vectorFilterMode": "preFilter",
73-
"vectorQueries": [
74-
{
75-
"kind": "vector",
76-
"vector": [
77-
-0.009154141,
78-
0.018708462,
79-
. . . // Trimmed for readability
80-
-0.02178128,
81-
-0.00086512347
82-
],
83-
"exhaustive": true,
84-
"fields": "contentVector",
85-
"k": 5
86-
}
87-
]
88-
}
68+
{
69+
"count": true,
70+
"select": "title, content, category",
71+
"filter": "category eq 'Databases'",
72+
"vectorFilterMode": "preFilter",
73+
"vectorQueries": [
74+
{
75+
"kind": "vector",
76+
"vector": [
77+
-0.009154141,
78+
0.018708462,
79+
. . . // Trimmed for readability
80+
-0.02178128,
81+
-0.00086512347
82+
],
83+
"fields": "contentVector",
84+
"k": 50
85+
}
86+
]
87+
}
8988
```
9089

9190
In this example, the vector embedding targets the `contentVector` field, and the filter criteria apply to `category`, a filterable text field. Because the `preFilter` mode is used, the filter is applied before the search engine runs the query, so only documents in the `Databases` category are considered during the vector search.

0 commit comments

Comments
 (0)