Skip to content

Commit 1789cc6

Browse files
committed
checkpoint, structure updates, and fleshing out the outline
1 parent 8d826d2 commit 1789cc6

File tree

14 files changed

+185
-72
lines changed

14 files changed

+185
-72
lines changed

docs/01_Welcome.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Welcome
2+
3+
Welcome to the Atlas Search Fundamentals Workshop! In this interactive session, you'll learn how to use the MongoDB Atlas Search Playground to create and test powerful search queries for an Airbnb-like dataset, all without the need for setting up your own cluster.
4+
5+
This workshop presents the fundamental concepts of the full-text search capabilities provided by Atlas Search, and empowers developers with best practice techniques to bring powerful search experiences to their applications. Developers will engage with a number of practical exercises to gain experience and confidence in understanding textual analysis and tokenization, configuring field types, and leveraging search operators for better relevancy.
6+
7+
## What You'll Learn
8+
9+
1. **Atlas Search overview**
10+
- System architecture
11+
- Index configuration
12+
- Inverted index
13+
14+
2. **Analysis**
15+
- Built-in analyzers
16+
- Multi analysis
17+
18+
3. **Search operators**
19+
- Text operators
20+
- Query construction
21+
22+
4. **Relevancy**
23+
- Scoring
24+
- TF/IDF and BM25
25+
26+
5. **Data modeling and schema design for Atlas Search**
27+
- Best practices

docs/10_Architecture/1_system.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# 📘 Atlas Search architecture
2+
3+
![system diagram](/img/system_diagram.png)
4+
5+
6+
## Coupled nodes
7+
![coupled nodes](/img/coupled.png)
8+
9+
## Dedicated search nodes
10+
![dedicated search nodes](/img/search_nodes.png)
11+
12+
## Aggregation pipeline search stages
13+
14+
### $search
15+
16+
where the magic happens
17+
18+
### $searchMeta
19+
20+
The `$searchMeta` stage performs the same search that `$search` does, but only returns the results metadata, not actual matching documents. Results metadata includes the count of matching results and facets. This same metadata is available when using `$search` too, accessible in the $$SEARCH_META context variable.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# 📘 Index configuration
2+
3+
Documents are mapped to an index through a flexible configuration.
4+
5+
* https://www.mongodb.com/docs/atlas/atlas-search/define-field-mappings/
6+
7+
## Supported types
8+
9+
## Dynamic mapping
10+
11+
## String-focused workshop
12+
13+
Most data types are queried straightforwardly, and match as one would expect. We'll survey non-string types in the next section, however we primarily focus on `string` fields, as that's where the power of Atlas Search shines.
14+
15+
## Configuring a real Atlas Search index
16+
17+
* Visual Index Builder
18+
* via Compass
19+
* Atlas CLI

docs/10_Introduction/1_welcome.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

docs/10_Introduction/2_playground.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/10_Introduction/3_architecture.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/10_Introduction/4_index_config.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/15_Playground/1_intro.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# 📘 Atlas Search Playground
2+
3+
The Atlas Search Playground (or just Playground) is used for the exercises in this workshop. The Playground is a self-contained lightweight, yet feature-rich Atlas Search environment which does not require an Atlas account to use.
4+
5+
There are two tools in the Playground:
6+
* Code Sandbox: your data, an index configuration, an aggregation pipeline, and results
7+
* Search Demo Builder: a configurable search UI on your data
8+
9+
The exercises will use the Code Sandbox, as it allows saving and sharing links to the full environment and corresponds directly to the configuration and pipeline one would use in a real application.
10+
11+
## Code Sandbox layout
12+
13+
To begin, please navigate to the [Atlas Search Playground](https://search-playground.mongodb.com/). In the next section, you'll work through the first exercise to get familiar with the Playground's Code Sandbox.
14+
15+
Let's dive into the world of Atlas Search using this convenient and powerful playground!
16+
17+
## Resources
18+
* https://www.mongodb.com/developer/products/atlas/search-playground-intro/

docs/15_Playground/2_lets_go.mdx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# 👐 Our first playground exercise
2+
3+
1. Navigate to this Playground snapshot:
4+
https://search-playground.mongodb.com/tools/code-sandbox/snapshots/6782aea0667feaaf06324b87
5+
2. Press "Run" (TODO: bring in the Run graphic)
6+
3. Notice the empty `[]` results
7+
8+
The objective with this exercise is to adjust the `FIX_ME` in the `$search` aggregation pipeline stage so that the document (in the Data Source pane) matches the query and appears in the Results pane.
9+
10+
TODO: insert un-fixed playground screenshot
11+
12+
<details>
13+
<summary>Here's a solution</summary>
14+
<div>
15+
```js
16+
[
17+
{
18+
$search: {
19+
index: "default",
20+
text: {
21+
query: "search",
22+
path: "title"
23+
}
24+
}
25+
}
26+
]
27+
```
28+
</div>
29+
</details>
30+
31+
<details>
32+
<summary>There are other possible solutions too</summary>
33+
<div>
34+
`atlas` or `fundamentals` or other case variations of any `title` field words
35+
</div>
36+
</details>

docs/15_Playground/3_data_types

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Field types
2+
3+
## boolean
4+
equals: https://search-playground.corp.mongodb.com/tools/code-playground/snapshots/669e6ab1d49ef6fad98118b4
5+
6+
## date
7+
range: https://search-playground.corp.mongodb.com/tools/code-playground/snapshots/669e6b18d49ef6fad98118b6
8+
9+
## number
10+
range: https://search-playground.corp.mongodb.com/tools/code-playground/snapshots/669e6b4ad49ef6fad98118b8
11+
12+
## geo
13+
geoWithin: https://search-playground.corp.mongodb.com/tools/code-playground/snapshots/669e6b762ce7658e786edbfa
14+
Requires explicit geo type mapping, since dynamic mappings don’t support geo.
15+
16+
## autocomplete
17+
blah, don’t do it! ;)
18+
See also: Relevant As-You-Type Suggestions Search Solution
19+
20+
## document
21+
22+
Default dynamic mapping behavior, flattens nested documents into “arrays” of values on main document
23+
24+
## embeddedDocument
25+
Attribute pattern k/v matching, more nuanced than document type flattening
26+
See cool tricks for embedded documents
27+
28+
## string
29+
Basic examples
30+
lucene.standard matching case-insensitive: https://search-playground.mongodb.com/tools/code-playground/snapshots/664738af4e0a3f240a5de9d9
31+
32+
## Analysis matters
33+
“searches” query does not match “Search” with lucene.standard: https://search-playground.mongodb.com/tools/code-playground/snapshots/664739964e0a3f240a5de9db
34+
“searches” matches “Search” using lucene.english: https://search-playground.mongodb.com/tools/code-playground/snapshots/66473aa64e0a3f240a5de9dd
35+
36+
## Custom analyzers
37+
Last 4 digit of phone number matching (regex extraction during indexing, keyword analysis at query time): https://search-playground.corp.mongodb.com/tools/code-playground/snapshots/669e6c98d49ef6fad98118ba
38+
Example of being able to do ‘startsWith’ and ‘endsWith’ using wildcard and ‘reverse’ token filter:
39+
https://search-playground.corp.mongodb.com/tools/code-playground/snapshots/6683c8bc4a45448733549bbc
40+
41+
Example of being able to do ‘startsWith’, ‘endsWith’ and ‘contains’ using nGrams: https://search-playground.corp.mongodb.com/tools/code-playground/snapshots/6683c999934a05d9b585b6e7
42+
Relevancy
43+
Example of an as-you-type suggest configuration; sophisticated use of multi and several weighted query clauses: https://search-playground.mongodb.com/tools/code-playground/snapshots/66473b744e0a3f240a5de9e1
44+
$project score?
45+
$project scoreDetails?
46+
47+
# multi
48+
Why?
49+
Relevancy example: boost each multi uniquely
50+
Multiple language example: may not know the language of the content and each document could be different - multi across all possible languages, query across them as desired at query-time, let relevancy sort it out
51+
Example of being able to do ‘startsWith’ and ‘endsWith’ using wildcard and ‘reverse’ token filter:
52+
https://search-playground.corp.mongodb.com/tools/code-playground/snapshots/6683c8bc4a45448733549bbc
53+

0 commit comments

Comments
 (0)