Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skills/full-text-search/fts-hybrid-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const kwHits = await db.products.aggregate([
// Vector arm
const qv = await embed(userQuery);
const vecHits = await db.products.aggregate([
{ $search: { cosmosSearch: { path: "embedding", query: qv, k: 50 } } },
{ $search: { cosmosSearch: { path: "embedding", vector: qv, k: 50 } } },
{ $project: { _id: 1, vec: { $meta: "searchScore" } } }
]).toArray();

Expand Down
4 changes: 2 additions & 2 deletions skills/vector-search/vector-knn-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Or post-filtering that drops 90% of your top-k before the user sees anything:

```javascript
db.products.aggregate([
{ $search: { cosmosSearch: { path: "embedding", query: qv, k: 10 } } },
{ $search: { cosmosSearch: { path: "embedding", vector: qv, k: 10 } } },
{ $match: { inStock: true, price: { $lte: 100 } } } // may leave 1-2 results
]);
```
Expand All @@ -37,7 +37,7 @@ const hits = await db.products.aggregate([
$search: {
cosmosSearch: {
path: "embedding",
query: queryVector,
vector: queryVector,
k: 10,
lSearch: 100, // higher than k, boosts recall
filter: {
Expand Down
Loading