-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
8,181 additions
and
6,421 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
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 #tokenOrder | ||
- | ||
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 |
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,156 @@ | ||
# $schema: ../schema.json | ||
name: compound | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/equals/' | ||
type: | ||
- searchOperator | ||
encode: object | ||
description: | | ||
The compound operator combines two or more operators into a single query. | ||
Each element of a compound query is called a clause, and each clause | ||
consists of one or more sub-queries. | ||
arguments: | ||
- | ||
name: must | ||
optional: true | ||
type: | ||
- searchOperator | ||
- array # of searchOperator | ||
- | ||
name: mustNot | ||
optional: true | ||
type: | ||
- searchOperator | ||
- array # of searchOperator | ||
- | ||
name: should | ||
optional: true | ||
type: | ||
- searchOperator | ||
- array # of searchOperator | ||
- | ||
name: filter | ||
optional: true | ||
type: | ||
- searchOperator | ||
- array # of searchOperator | ||
- | ||
name: minimumShouldMatch | ||
optional: true | ||
type: | ||
- int | ||
- | ||
name: score | ||
optional: true | ||
type: | ||
- searchScore | ||
tests: | ||
- | ||
name: 'must and mustNot' | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/compound/#must-and-mustnot-example' | ||
pipeline: | ||
- | ||
$search: | ||
compound: | ||
must: | ||
- | ||
text: | ||
query: 'varieties' | ||
path: 'description' | ||
mustNot: | ||
- | ||
text: | ||
query: 'apples' | ||
path: 'description' | ||
|
||
- | ||
name: 'must and should' | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/compound/#must-and-should-example' | ||
pipeline: | ||
- | ||
$search: | ||
compound: | ||
must: | ||
- | ||
text: | ||
query: 'varieties' | ||
path: 'description' | ||
should: | ||
- | ||
text: | ||
query: 'Fuji' | ||
path: 'description' | ||
- | ||
$project: | ||
score: | ||
$meta: 'searchScore' | ||
|
||
- | ||
name: 'minimumShouldMatch' | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/compound/#minimumshouldmatch-example' | ||
pipeline: | ||
- | ||
$search: | ||
compound: | ||
must: | ||
- | ||
text: | ||
query: 'varieties' | ||
path: 'description' | ||
should: | ||
- | ||
text: | ||
query: 'Fuji' | ||
path: 'description' | ||
- | ||
text: | ||
query: 'Golden Delicious' | ||
path: 'description' | ||
minimumShouldMatch: 1 | ||
|
||
- | ||
name: 'Filter' | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/compound/#filter-examples' | ||
pipeline: | ||
- | ||
$search: | ||
compound: | ||
must: | ||
- | ||
text: | ||
query: 'varieties' | ||
path: 'description' | ||
should: | ||
- | ||
text: | ||
query: 'banana' | ||
path: 'description' | ||
filter: | ||
- | ||
text: | ||
query: 'granny' | ||
path: 'description' | ||
|
||
- | ||
name: 'Nested' | ||
link: 'https://www.mongodb.com/docs/atlas/atlas-search/compound/#nested-example' | ||
pipeline: | ||
- | ||
$search: | ||
compound: | ||
should: | ||
- | ||
text: | ||
query: 'apple' | ||
path: 'type' | ||
- | ||
compound: | ||
must: | ||
- | ||
text: | ||
query: 'organic' | ||
path: 'category' | ||
- | ||
equals: | ||
value: true | ||
path: 'in_stock' | ||
minimumShouldMatch: 1 |
Oops, something went wrong.