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
59 changes: 58 additions & 1 deletion definitions/stage/vectorSearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ arguments:
type:
- query
description: |
Any match query that compares an indexed field with a boolean, date, objectId, number (not decimals), string, or UUID to use as a pre-filter.
Any match query that compares an indexed field with a boolean, date, objectId, number, string, or UUID to use as a pre-filter.
- name: numCandidates
optional: true
type:
Expand All @@ -55,6 +55,25 @@ arguments:
- bool
description: |
If true, the search returns only the stored source fields configured on the index directly from the index and skips a full document lookup. If omitted, the default value is false.
- name: nestedOptions
optional: true
type:
- object
description: |
Configure how MongoDB Vector Search scores documents that contain nested arrays.
arguments:
- name: scoreMode
optional: true
type:
- string
description: |
Specifies how to score documents that contain nested arrays. Value can be avg or max.
Comment thread
paulinevos marked this conversation as resolved.
- name: parentFilter
optional: true
type:
- query
description: |
Any match query that compares an indexed top-level field with a boolean, date, objectId, number, string, or UUID to use as a pre-filter. Only valid if `nestedRoot` is specified in the index definition.
tests:
- name: ANN Basic
link: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/#examples
Expand Down Expand Up @@ -209,3 +228,41 @@ tests:
title:
types:
- bsonType: String
- name: Nested field
link: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/#examples
pipeline:
- $vectorSearch:
index: vector_index
filter:
reviews.date:
$gte: !bson_utcdatetime "2000-01-01"
parentFilter:
address.country:
$in:
- United States
Comment thread
paulinevos marked this conversation as resolved.
bedrooms:
$gte: 2
$lte: 3
property_type:
$in:
- House
- Apartment
path: reviews.comments_embedding
queryVector: # skip other numbers, not relevant to the test
- 0.010745884850621223
- -0.035673413425683975
- -0.09298479557037354
numCandidates: 100
limit: 5
nestedOptions:
scoreMode: avg
- $project:
_id: 0
name: 1
address: 1
neighborhood_overview: 1
bedrooms: 1
property_type: 1
reviews.comments: 1
score:
$meta: vectorSearchScore
Empty file modified scripts/lint.sh
100644 → 100755
Empty file.
Loading