-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PHPLIB-1596 Fully describe $search, $searchMeta and $vectorSearch stages
- Loading branch information
Showing
56 changed files
with
4,793 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"repositories": [ | ||
{ | ||
"type": "path", | ||
"url": "../", | ||
"url": "..", | ||
"symlink": true | ||
} | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
# $schema: ../schema.json | ||
name: autocomplete | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/' | ||
type: | ||
- searchOperator | ||
encode: object | ||
description: | | ||
The autocomplete operator performs a search for a word or phrase that | ||
contains a sequence of characters from an incomplete input string. The | ||
fields that you intend to query with the autocomplete operator must be | ||
indexed with the autocomplete data type in the collection's index definition. | ||
arguments: | ||
- | ||
name: path | ||
type: | ||
- searchPath | ||
- | ||
name: query | ||
type: | ||
- string | ||
- | ||
name: tokenOrder | ||
optional: true | ||
type: | ||
- string # any|sequential | ||
- | ||
name: fuzzy | ||
optional: true | ||
type: | ||
- object | ||
- | ||
name: score | ||
optional: true | ||
type: | ||
- searchScore | ||
tests: | ||
- | ||
name: 'Basic' | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/#basic-example' | ||
pipeline: | ||
- | ||
$search: | ||
autocomplete: | ||
query: 'off' | ||
path: 'title' | ||
- | ||
$limit: 10 | ||
- | ||
$project: | ||
_id: 0 | ||
title: 1 | ||
|
||
- | ||
name: 'Fuzzy' | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/#fuzzy-example' | ||
pipeline: | ||
- | ||
$search: | ||
autocomplete: | ||
query: 'pre' | ||
path: 'title' | ||
fuzzy: | ||
maxEdits: 1 | ||
prefixLength: 1 | ||
maxExpansions: 256 | ||
- | ||
$limit: 10 | ||
- | ||
$project: | ||
_id: 0 | ||
title: 1 | ||
|
||
- | ||
name: 'Token Order any' | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/#simple-any-example' | ||
pipeline: | ||
- | ||
$search: | ||
autocomplete: | ||
query: 'men with' | ||
path: 'title' | ||
tokenOrder: 'any' | ||
- | ||
$limit: 4 | ||
- | ||
$project: | ||
_id: 0 | ||
title: 1 | ||
|
||
- | ||
name: 'Token Order sequential' | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/#simple-sequential-example' | ||
pipeline: | ||
- | ||
$search: | ||
autocomplete: | ||
query: 'men with' | ||
path: 'title' | ||
tokenOrder: 'sequential' | ||
- | ||
$limit: 4 | ||
- | ||
$project: | ||
_id: 0 | ||
title: 1 | ||
|
||
- | ||
name: 'Highlighting' | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/#highlighting-example' | ||
pipeline: | ||
- | ||
$search: | ||
autocomplete: | ||
query: 'ger' | ||
path: 'title' | ||
highlight: | ||
path: 'title' | ||
- | ||
$limit: 5 | ||
- | ||
$project: | ||
score: | ||
$meta: 'searchScore' | ||
_id: 0 | ||
title: 1 | ||
highlights: | ||
$meta: 'searchHighlights' | ||
|
||
- | ||
name: 'Across Multiple Fields' | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/#search-across-multiple-fields' | ||
pipeline: | ||
- | ||
$search: | ||
compound: | ||
should: | ||
- | ||
autocomplete: | ||
query: 'inter' | ||
path: 'title' | ||
- | ||
autocomplete: | ||
query: 'inter' | ||
path: 'plot' | ||
minimumShouldMatch: 1 | ||
- | ||
$limit: 10 | ||
- | ||
$project: | ||
_id: 0 | ||
title: 1 | ||
plot: 1 |
Oops, something went wrong.