You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/40_Analysis/8_Exercises/2_.mdx
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,17 @@
1
1
# Exercises: English
2
2
3
-
Adjust the index configuration without touching the pipeline or query
3
+
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c721ee97570c2714a07ee">🔗 Playground link: "searches" query does not match "Search"</Playground>
4
+
5
+
Adjust the index configuration without touching the pipeline or query.
6
+
The default `lucene.standard` does basic, language-insensitive, analysis. There's a better language-specific analyzer choice that will solve this challenge.
4
7
5
-
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c721ee97570c2714a07ee">“searches” query does not match “Search” with `lucene.standard`</Playground>
6
8
<details>
7
9
<summary>Solution</summary>
8
10
<div>
9
11
```js
10
12
"analyzer":"lucene.english"
11
13
```
12
-
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c3f2ae97570c2714a07ea">solution using `lucene.english` analyzer</Playground>
14
+
🔗 <Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c3f2ae97570c2714a07ea">solution using `lucene.english` analyzer</Playground>
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c70b3d0df60f0254e5d43">configure an appropriate analyzer</Playground>
3
+
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c70b3d0df60f0254e5d43">🔗 Playground link: configure an appropriate analyzer</Playground>
4
4
<details>
5
5
<summary>Solution</summary>
6
6
<div>
7
7
```js
8
8
"analyzer":"lucene.portuguese"
9
9
```
10
-
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c7123d0df60f0254e5d45">solution using the `lucene.portuguese` analyzer</Playground>
10
+
🔗 <Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c7123d0df60f0254e5d45">solution using the `lucene.portuguese` analyzer</Playground>
Copy file name to clipboardExpand all lines: docs/50_Querying/8_Exercises/1_.mdx
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,27 +5,30 @@ in looser/fuzzier ways, then tackle these exercises.
5
5
6
6
# matchCriteria
7
7
8
-
Loosen up this query so the document matches: <Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c8e77e97570c2714a07f2">all terms do no match</Playground>
8
+
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c8e77e97570c2714a07f2">🔗 Playground link: all terms do no match</Playground>
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c915dd0df60f0254e5d51">Adjust the `text` operator settings so that this document matches</Playground>
25
+
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c915dd0df60f0254e5d51">🔗 Playground link: Adjust the `text` operator settings so that this document matches</Playground>
Copy file name to clipboardExpand all lines: docs/50_Querying/8_Exercises/2_.mdx
+2-6Lines changed: 2 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Phrases match terms in proximity to one another, either exact order with no word
4
4
5
5
HINT: See the [`phrase` operator docs](https://www.mongodb.com/docs/atlas/atlas-search/phrase/) for these exercises.
6
6
7
-
Fix this <Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c8ff7e97570c2714a07f8">not close enough phrase match</Playground>
7
+
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c8ff7e97570c2714a07f8">🔗 Playground link: not close enough phrase match</Playground>
8
8
<details>
9
9
<summary>Solution</summary>
10
10
<div>
@@ -16,10 +16,6 @@ Fix this <Playground url="https://search-playground.corp.mongodb.com/tools/code-
16
16
But you can't adjust what the users query for, so the configuration or search operators need
17
17
to be adjusted.
18
18
19
-
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c909ad0df60f0254e5d49">solution using phrase `slop`</Playground>
19
+
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/679c909ad0df60f0254e5d49">🔗 solution using phrase `slop`</Playground>
20
20
</div>
21
21
</details>
22
-
23
-
# TODO
24
-
25
-
There's another setting than "slop" which allows out of order. It looks like we need to add it to the exercise/solution
Copy file name to clipboardExpand all lines: docs/50_Querying/8_Exercises/3_.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## `wildcard`
4
4
5
-
<Playgroundurl="https://search-playground.mongodb.com/tools/code-sandbox/snapshots/67d1e0cd20b1632e508742aa">words that starts-with not matching as expected</Playground>
5
+
<Playgroundurl="https://search-playground.mongodb.com/tools/code-sandbox/snapshots/67d1e0cd20b1632e508742aa">🔗 Playground link: words that starts-with not matching as expected</Playground>
6
6
<details>
7
7
<summary>Solution</summary>
8
8
<div>
@@ -13,13 +13,13 @@
13
13
14
14
And `allowAnalyzedField: true` needs to be set, allowing searches when using a tokenizing analyzer.
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/67d1dff6643f61797f19d319">Full string regex not working as expected</Playground>
22
+
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/67d1dff6643f61797f19d319">🔗 Playground link: Full string regex not working as expected</Playground>
23
23
<details>
24
24
<summary>Solution</summary>
25
25
<div>
@@ -29,7 +29,7 @@
29
29
Matching needs to occur across the full string, and thus needs to be `lucene.keyword`
30
30
analyzed so that the full string is indexed as a single unit.
<Playgroundurl="https://search-playground.mongodb.com/tools/code-sandbox/snapshots/67d2ee9b643f61797f19d33c">add the score details into the results</Playground>
23
+
<Playgroundurl="https://search-playground.mongodb.com/tools/code-sandbox/snapshots/67d2ee9b643f61797f19d33c">🔗 Playground link: add the score details into the results</Playground>
24
+
25
+
Enable the score details and project them into the results.
26
+
23
27
<details>
24
28
<summary>Solution</summary>
25
29
<div>
@@ -34,13 +38,16 @@ Fix this Playground so that the `score` being projected is the relevancy score A
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/67d2eddb643f61797f19d33a">task: set the search (relevance) score to the value of our custom `weight` field</Playground>
47
+
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/67d2eddb643f61797f19d33a">🔗 Playground link: task: score documents by document field</Playground>
48
+
49
+
Set the search (relevance) score to the value of the `weight` field.
50
+
44
51
<details>
45
52
<summary>Solution</summary>
46
53
<div>
@@ -52,6 +59,6 @@ Fix this Playground so that the `score` being projected is the relevancy score A
Copy file name to clipboardExpand all lines: docs/70_Data_Modeling/8_Exercises.mdx
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,10 @@
2
2
3
3
## Only make searchable a specific subset of fields
4
4
5
-
First, see how <Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/67b5ccc0828ad15116bcce21">a string field is automatically searchable</Playground> but now make it so only fields under the `metadata` structure are indexed (and thus this query would then fail to find any matching documents)
5
+
<Playgroundurl="https://search-playground.corp.mongodb.com/tools/code-sandbox/snapshots/67b5ccc0828ad15116bcce21">🔗 Playground link: a dynamic string field is automatically searchable</Playground>
6
+
7
+
Make it so only fields under the `metadata` structure are indexed (and thus this query would then fail to find any matching documents). This is an exercise where no matching documents (an empty array `[]`) is the goal, rather than matching on a field that should not be indexed.
8
+
6
9
<details>
7
10
<summary>Solution</summary>
8
11
<div>
@@ -22,6 +25,6 @@ First, see how <Playground url="https://search-playground.corp.mongodb.com/tools
0 commit comments