Skip to content

Commit 64a44ad

Browse files
committed
add search schemas
1 parent fd06dd6 commit 64a44ad

17 files changed

+3207
-0
lines changed

generator/config/search/autocomplete.yaml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,143 @@ tests:
4040
- $project:
4141
_id: 0
4242
title: 1
43+
schema:
44+
movies: &ref_0
45+
_id:
46+
types:
47+
- bsonType: Document
48+
fields:
49+
$oid:
50+
types:
51+
- bsonType: String
52+
title:
53+
types:
54+
- bsonType: String
55+
year:
56+
types:
57+
- bsonType: Document
58+
fields:
59+
$numberInt:
60+
types:
61+
- bsonType: String
62+
runtime:
63+
types:
64+
- bsonType: Document
65+
fields:
66+
$numberInt:
67+
types:
68+
- bsonType: String
69+
released:
70+
types:
71+
- bsonType: Document
72+
fields:
73+
$date:
74+
types:
75+
- bsonType: Document
76+
fields:
77+
$numberLong:
78+
types:
79+
- bsonType: String
80+
poster:
81+
types:
82+
- bsonType: String
83+
plot:
84+
types:
85+
- bsonType: String
86+
fullplot:
87+
types:
88+
- bsonType: String
89+
lastupdated:
90+
types:
91+
- bsonType: String
92+
type:
93+
types:
94+
- bsonType: String
95+
directors:
96+
types:
97+
- bsonType: Array
98+
types:
99+
- bsonType: String
100+
imdb:
101+
types:
102+
- bsonType: Document
103+
fields:
104+
rating:
105+
types:
106+
- bsonType: Document
107+
fields:
108+
$numberDouble:
109+
types:
110+
- bsonType: String
111+
votes:
112+
types:
113+
- bsonType: Document
114+
fields:
115+
$numberInt:
116+
types:
117+
- bsonType: String
118+
id:
119+
types:
120+
- bsonType: Document
121+
fields:
122+
$numberInt:
123+
types:
124+
- bsonType: String
125+
cast:
126+
types:
127+
- bsonType: Array
128+
types:
129+
- bsonType: String
130+
countries:
131+
types:
132+
- bsonType: Array
133+
types:
134+
- bsonType: String
135+
genres:
136+
types:
137+
- bsonType: Array
138+
types:
139+
- bsonType: String
140+
tomatoes:
141+
types:
142+
- bsonType: Document
143+
fields:
144+
viewer:
145+
types:
146+
- bsonType: Document
147+
fields:
148+
rating:
149+
types:
150+
- bsonType: Document
151+
fields:
152+
$numberDouble:
153+
types:
154+
- bsonType: String
155+
numReviews:
156+
types:
157+
- bsonType: Document
158+
fields:
159+
$numberInt:
160+
types:
161+
- bsonType: String
162+
lastUpdated:
163+
types:
164+
- bsonType: Document
165+
fields:
166+
$date:
167+
types:
168+
- bsonType: Document
169+
fields:
170+
$numberLong:
171+
types:
172+
- bsonType: String
173+
num_mflix_comments:
174+
types:
175+
- bsonType: Document
176+
fields:
177+
$numberInt:
178+
types:
179+
- bsonType: String
43180
- name: Fuzzy
44181
link: https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/#fuzzy-example
45182
pipeline:
@@ -55,6 +192,8 @@ tests:
55192
- $project:
56193
_id: 0
57194
title: 1
195+
schema:
196+
movies: *ref_0
58197
- name: Token Order any
59198
link: https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/#simple-any-example
60199
pipeline:
@@ -67,6 +206,8 @@ tests:
67206
- $project:
68207
_id: 0
69208
title: 1
209+
schema:
210+
movies: *ref_0
70211
- name: Token Order sequential
71212
link: https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/#simple-sequential-example
72213
pipeline:
@@ -79,6 +220,8 @@ tests:
79220
- $project:
80221
_id: 0
81222
title: 1
223+
schema:
224+
movies: *ref_0
82225
- name: Highlighting
83226
link: https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/#highlighting-example
84227
pipeline:
@@ -96,6 +239,8 @@ tests:
96239
title: 1
97240
highlights:
98241
$meta: searchHighlights
242+
schema:
243+
movies: *ref_0
99244
- name: Across Multiple Fields
100245
link: https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/#search-across-multiple-fields
101246
pipeline:
@@ -114,3 +259,5 @@ tests:
114259
_id: 0
115260
title: 1
116261
plot: 1
262+
schema:
263+
movies: *ref_0

generator/config/search/compound.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,23 @@ tests:
5151
- text:
5252
query: apples
5353
path: description
54+
schema:
55+
TestCollection:
56+
_id:
57+
types:
58+
- bsonType: Number
59+
type:
60+
types:
61+
- bsonType: String
62+
description:
63+
types:
64+
- bsonType: String
65+
category:
66+
types:
67+
- bsonType: String
68+
in_stock:
69+
types:
70+
- bsonType: Boolean
5471
- name: must and should
5572
link: https://www.mongodb.com/docs/atlas/atlas-search/compound/#must-and-should-example
5673
pipeline:
@@ -67,6 +84,23 @@ tests:
6784
- $project:
6885
score:
6986
$meta: searchScore
87+
schema:
88+
TestCollection:
89+
_id:
90+
types:
91+
- bsonType: Number
92+
type:
93+
types:
94+
- bsonType: String
95+
description:
96+
types:
97+
- bsonType: String
98+
category:
99+
types:
100+
- bsonType: String
101+
in_stock:
102+
types:
103+
- bsonType: Boolean
70104
- name: minimumShouldMatch
71105
link: https://www.mongodb.com/docs/atlas/atlas-search/compound/#minimumshouldmatch-example
72106
pipeline:
@@ -84,6 +118,23 @@ tests:
84118
query: Golden Delicious
85119
path: description
86120
minimumShouldMatch: 1
121+
schema:
122+
TestCollection:
123+
_id:
124+
types:
125+
- bsonType: Number
126+
type:
127+
types:
128+
- bsonType: String
129+
description:
130+
types:
131+
- bsonType: String
132+
category:
133+
types:
134+
- bsonType: String
135+
in_stock:
136+
types:
137+
- bsonType: Boolean
87138
- name: Filter
88139
link: https://www.mongodb.com/docs/atlas/atlas-search/compound/#filter-examples
89140
pipeline:
@@ -101,6 +152,23 @@ tests:
101152
- text:
102153
query: granny
103154
path: description
155+
schema:
156+
TestCollection:
157+
_id:
158+
types:
159+
- bsonType: Number
160+
type:
161+
types:
162+
- bsonType: String
163+
description:
164+
types:
165+
- bsonType: String
166+
category:
167+
types:
168+
- bsonType: String
169+
in_stock:
170+
types:
171+
- bsonType: Boolean
104172
- name: Nested
105173
link: https://www.mongodb.com/docs/atlas/atlas-search/compound/#nested-example
106174
pipeline:
@@ -119,3 +187,20 @@ tests:
119187
value: true
120188
path: in_stock
121189
minimumShouldMatch: 1
190+
schema:
191+
TestCollection:
192+
_id:
193+
types:
194+
- bsonType: Number
195+
type:
196+
types:
197+
- bsonType: String
198+
description:
199+
types:
200+
- bsonType: String
201+
category:
202+
types:
203+
- bsonType: String
204+
in_stock:
205+
types:
206+
- bsonType: Boolean

0 commit comments

Comments
 (0)