SlideShare a Scribd company logo
#MDBlocal
Atlas Search Deep Dive
Will Chow
Senior Solutions Architect, MongoDB
TORONTO
#MDBLocal
{
“name”: “Will Chow”,
“MongoDB”: {
“positions”: [“Senior Solutions Architect”],
“since” : new Date (“2018-10”),
},
“Pre-MongoDB”: {
“positions”: [“Systems Engineer”, “Architect”, “Developer”],
“companies”: [ “Cloudera”, “IBM”, “DataMirror”]
},
“likes”: [“running”, “renovating” ]
}
About Me
#MDBLocal
AGENDA
Why Full
Text
Search?
Atlas
Search
Features
Queries +
How They
Work
Indexes and
Analyzers
Architecture
Why Full-Text Search?
Search is a requirement
for most applications
#MDBLocal
Why didn’t
[thing I want]
show up first?
#MDBLocal
Relevance is Complicated… Developer: “This result doesn’t
match the most terms.”
Marketing: “Why isn’t the promo on
top?”
Product: “If I type in an exact
product name, just skip the search.”
UX: “Users need categories
instead.”
CEO: “Change the top result right
NOW!”
Customer: “Je ne trouve pas ce que
je cherche …”
#MDBLocal
RelevanceisCritical
#MDBLocal
Searching with Text Search - $text
db.movies.find
({$text: {$search: "chikago"}},
{score: {$meta: "textScore"},
_id : 0,
title: 1,
fullplot: 1
}).sort
({score:{$meta:"textScore"}}).pretty()
[] (empty set)
#MDBLocal
Sync
#MDBLocal
Atlas Search Features
Native
Powered by
Performant
Text Indexes
Powerful
Query
Operators
Configurable
Language
Analyzers
Built-in
Highlighting
Flexible
Scoring
#MDBLocal
Atlas Search Features
Native
Powered by
Score is the Measure of Relevance Flexible
Scoring
#MDBLocal
So, build the best search
for your application
Atlas Search
Full Text Search Indexes
$searchBeta
#MDBLocal
How do I use it?
Create a cluster
on MongoDB
Atlas 4.2
(M30+)
Create a
database and
collection
Create a full
text index on
that collection
in Atlas
Query via
$searchBeta
aggregation
pipeline
#MDBLocal
Full Text Search Index
Creation
Dynamic Mapping
Static Mapping
#MDBLocal
Sample_mflix movies
document model
#MDBLocal
Searching with Full Text Search - $searchBeta
db.movies.aggregate([
{$searchBeta: { term: {
path: "title",
query: "chikago",
fuzzy: { "maxEdits": 1}},
highlight: { path: "fullplot"}}},
{$project: {
_id : 0,
title: 1,
score: { $meta: 'searchScore' },
highlights: { $meta: "searchHighlights"}}},
{$limit : 1}]).pretty()
{"title" : "Chicago",
"score" : 4.210028171539307,
highlights" : [{
path" : "fullplot",
"texts" : [
{"value" : "Murderess Velma Kelly finds herself on
death row in 1920s ",
"type" : "text"},
{"value" : "Chicago",
"type" : "hit"}],
"score" : 0.863726019859314}]}
#MDBLocal
db.movies.aggregate([
{ $match": {
"title": "The Godfather"
}},
{ $sort: { title: 1 } }
])
$searchBeta
db.movies.aggregate([
{ $searchBeta": {
"search": { query: "The Godfather",
path: "title",
score: { boost: {value: 3}}}}
])
Sort occurs after filter Sort occurs during filter
Query-time Scoring
DEMO
A Movie Search Engine using
Atlas Search
Will Chow
Architecture
How FTS works
#MDBLocal
MongoDB +
• Pre-existing functionality
• Highlights, Fuzzy-matching, Query-time scoring and
more
• Analyzers
• Language support
• Western languages: English, French, etc.
• Eastern Languages: CJK, Hindi, Thai, etc.
• Inverted index structure = fast searches
#MDBLocal
Inverted Index
{ _id: 1,
S: “The quick brown fox jumped over the lazy dog” }
{ _id: 2,
S: “Quick brown foxes leap over lazy dogs in summer” }
TERM DOC
The 1
Quick 2
brown 1, 2
fox 1
foxes 2
jumped 1
leap 2
TERM DOC
the 1
quick 1, 2
brown 1, 2
fox 1, 2
in 2
jump 1, 2
dog 1, 2
STEMMING,SYNONYMS
#MDBLocal
Real-world Inverted Index: A Concordance
#MDBLocal
Inverted Indices and Analyzers
“_id”: 3,
“title” : “Planes, Trains & Automobiles”
{
“planes” : [3, …],
“trains” : [3, …],
“automobiles” : [3, … ]
},
lucene.simple lucene.english
{
“plane” : [3, …],
“train” : [3, …],
“automobile” : [3, …],
}
lucene.keyword
{
“Planes, Trains &
Automobiles” : [3, …]
},
#MDBLocal
Querying and Analyzers
search: { query: “planes trains”,
path: “title” }
term(“plane”) OR
term(“train”)
term: { query: “planws”,
path: { value: “title”,
multi: ”simple”},
fuzzy: {maxEdits: 1 } }
Fuzzy(“planws”,
maxEdits: 1)
term: { query: “Planes(.*)”,
path: { value: “title”,
multi: ”keyword”},
regex: true} }
Regex(“Planes(.*)”)
lucene.keyword lucene.simple lucene.english
#MDBLocal
MongoDB Atlas FTS components
mongod mongos mongot (NEW!)
● $searchBeta aggregation
pipeline stage
● Talks mongodb wire
protocol to mongot
● Shard aware
implementation
● scatter-gather queries
● Based on Apache Lucene 8
● Integrated into MongoDB
Atlas
● Separate java process
from mongod
● collocated with mongod
#MDBLocal
FTS Indexing: Initial Sync
MongoDB Atlas
Query
Index Definition
Automation Agent
mongotmongod
Collection Scan
Complete!
#MDBLocal
FTS Indexing: Steady State
Documents
mongotmongod
changestream
MongoDB Atlas
(per node)
mongot watches
the changestream
continuously and
updates the
search index
#MDBLocal
Query Lifecycle
Wire Protocol
(over internet to
MongoDB Atlas) aggregate([ {$searchBeta: {
search: {
path: “name”,
query: “star wars”
}
}}]
mongod
Wire protocol
(localhost)
Lucene booleanQuery:
(should
(term(“name”, “star”),
term(“name”, wars”))
search: {
path: “name”,
query: “star wars”
}
[ { _id: “123”,score:
1.23,highlights: […] },
{…}]
{ “name” :
{ “star” : [123,124],
“wars” : [123,125,…]
}
}
Lookup([{_id: “123”],
{…}])
mongot
db.col.aggregate([
{$searchBeta: {
search: {
path: “name”,
query: “star wars”
}
}}])
app
[ { _id: “123”, title:
“Star Wars”}, {…}]
MongoDB Atlas Host
#MDBLocal
Sharding
• Merge
• Sort by score
mongos
request
result
per shard
per shard
• Scatter/gather
(each shard)
mongot,
mongod
mongot,
mongod
Primary Secondaries
Query
What’s next?
Feature Roadmap
#MDBLocal
• Expanded data type support
• Nums, dates, geo
• Synonyms
• Improved operators/syntax
• Architecture/performance
improvements
2019 Roadmap
#MDBLocal
Feedback
Visit cloud.mongodb.com
Please provide feedback using
the link on the FTS page.
We are listening!
DEMO
http://bit.ly/AtlasSearch_Movies
Key Takeaways
Ø Apache Lucene 8
Ø Uses MongoDB Query Language
Ø Wide variety of query operators – fuzzy, wildcard
Ø Flexible Scoring and Highlights
Ø Configurable Indexes
Ø Saves you time!!!
THANK YOU
#MDBlocal
Every session you rate enters you into a
drawing for a gift card!
https://www.surveymonkey.com/r/C8TFLRC
MongoDB Atlas Full-Text
Search Deep Dive
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive

More Related Content

Similar to MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive (20)

PDF
Getting Started: Atlas Search Webinar
Karen Huaulme
 
PDF
Full Text Search with Lucene
WO Community
 
PDF
Elasto Mania
andrefsantos
 
PPTX
Webinar: General Technical Overview of MongoDB for Dev Teams
MongoDB
 
PDF
MongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB
 
PPTX
Business Jumpstart: The Right (and Wrong) Use Cases for MongoDB
MongoDB
 
PDF
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB
 
PDF
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
Lisa Roth, PMP
 
PPTX
ElasticSearch AJUG 2013
Roy Russo
 
PPTX
Jumpstart: Introduction to MongoDB
MongoDB
 
PDF
Airbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Lucidworks
 
PDF
MongoDB .local Chicago 2019: MongoDB Atlas Jumpstart
MongoDB
 
PPTX
Jumpstart: Building Your First MongoDB App
MongoDB
 
PDF
Elasticsearch
Amine Ferchichi
 
PPTX
Sharing about MongoDB Overview and Indexing in MongoDB
TrnLTunKit
 
ODP
MongoDB : The Definitive Guide
Wildan Maulana
 
PPTX
Search enabled applications with lucene.net
Willem Meints
 
PPTX
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
MongoDB
 
PPTX
An Introduction to Elastic Search.
Jurriaan Persyn
 
PPTX
Analyzing Real-World Data with Apache Drill
tshiran
 
Getting Started: Atlas Search Webinar
Karen Huaulme
 
Full Text Search with Lucene
WO Community
 
Elasto Mania
andrefsantos
 
Webinar: General Technical Overview of MongoDB for Dev Teams
MongoDB
 
MongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB
 
Business Jumpstart: The Right (and Wrong) Use Cases for MongoDB
MongoDB
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
Lisa Roth, PMP
 
ElasticSearch AJUG 2013
Roy Russo
 
Jumpstart: Introduction to MongoDB
MongoDB
 
Airbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Lucidworks
 
MongoDB .local Chicago 2019: MongoDB Atlas Jumpstart
MongoDB
 
Jumpstart: Building Your First MongoDB App
MongoDB
 
Elasticsearch
Amine Ferchichi
 
Sharing about MongoDB Overview and Indexing in MongoDB
TrnLTunKit
 
MongoDB : The Definitive Guide
Wildan Maulana
 
Search enabled applications with lucene.net
Willem Meints
 
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
MongoDB
 
An Introduction to Elastic Search.
Jurriaan Persyn
 
Analyzing Real-World Data with Apache Drill
tshiran
 

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 
Ad

Recently uploaded (20)

PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Ad

MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive

  • 1. #MDBlocal Atlas Search Deep Dive Will Chow Senior Solutions Architect, MongoDB TORONTO
  • 2. #MDBLocal { “name”: “Will Chow”, “MongoDB”: { “positions”: [“Senior Solutions Architect”], “since” : new Date (“2018-10”), }, “Pre-MongoDB”: { “positions”: [“Systems Engineer”, “Architect”, “Developer”], “companies”: [ “Cloudera”, “IBM”, “DataMirror”] }, “likes”: [“running”, “renovating” ] } About Me
  • 4. Why Full-Text Search? Search is a requirement for most applications
  • 5. #MDBLocal Why didn’t [thing I want] show up first?
  • 6. #MDBLocal Relevance is Complicated… Developer: “This result doesn’t match the most terms.” Marketing: “Why isn’t the promo on top?” Product: “If I type in an exact product name, just skip the search.” UX: “Users need categories instead.” CEO: “Change the top result right NOW!” Customer: “Je ne trouve pas ce que je cherche …”
  • 8. #MDBLocal Searching with Text Search - $text db.movies.find ({$text: {$search: "chikago"}}, {score: {$meta: "textScore"}, _id : 0, title: 1, fullplot: 1 }).sort ({score:{$meta:"textScore"}}).pretty() [] (empty set)
  • 10. #MDBLocal Atlas Search Features Native Powered by Performant Text Indexes Powerful Query Operators Configurable Language Analyzers Built-in Highlighting Flexible Scoring
  • 11. #MDBLocal Atlas Search Features Native Powered by Score is the Measure of Relevance Flexible Scoring
  • 12. #MDBLocal So, build the best search for your application Atlas Search Full Text Search Indexes $searchBeta
  • 13. #MDBLocal How do I use it? Create a cluster on MongoDB Atlas 4.2 (M30+) Create a database and collection Create a full text index on that collection in Atlas Query via $searchBeta aggregation pipeline
  • 14. #MDBLocal Full Text Search Index Creation Dynamic Mapping Static Mapping
  • 16. #MDBLocal Searching with Full Text Search - $searchBeta db.movies.aggregate([ {$searchBeta: { term: { path: "title", query: "chikago", fuzzy: { "maxEdits": 1}}, highlight: { path: "fullplot"}}}, {$project: { _id : 0, title: 1, score: { $meta: 'searchScore' }, highlights: { $meta: "searchHighlights"}}}, {$limit : 1}]).pretty() {"title" : "Chicago", "score" : 4.210028171539307, highlights" : [{ path" : "fullplot", "texts" : [ {"value" : "Murderess Velma Kelly finds herself on death row in 1920s ", "type" : "text"}, {"value" : "Chicago", "type" : "hit"}], "score" : 0.863726019859314}]}
  • 17. #MDBLocal db.movies.aggregate([ { $match": { "title": "The Godfather" }}, { $sort: { title: 1 } } ]) $searchBeta db.movies.aggregate([ { $searchBeta": { "search": { query: "The Godfather", path: "title", score: { boost: {value: 3}}}} ]) Sort occurs after filter Sort occurs during filter Query-time Scoring
  • 18. DEMO A Movie Search Engine using Atlas Search Will Chow
  • 20. #MDBLocal MongoDB + • Pre-existing functionality • Highlights, Fuzzy-matching, Query-time scoring and more • Analyzers • Language support • Western languages: English, French, etc. • Eastern Languages: CJK, Hindi, Thai, etc. • Inverted index structure = fast searches
  • 21. #MDBLocal Inverted Index { _id: 1, S: “The quick brown fox jumped over the lazy dog” } { _id: 2, S: “Quick brown foxes leap over lazy dogs in summer” } TERM DOC The 1 Quick 2 brown 1, 2 fox 1 foxes 2 jumped 1 leap 2 TERM DOC the 1 quick 1, 2 brown 1, 2 fox 1, 2 in 2 jump 1, 2 dog 1, 2 STEMMING,SYNONYMS
  • 23. #MDBLocal Inverted Indices and Analyzers “_id”: 3, “title” : “Planes, Trains & Automobiles” { “planes” : [3, …], “trains” : [3, …], “automobiles” : [3, … ] }, lucene.simple lucene.english { “plane” : [3, …], “train” : [3, …], “automobile” : [3, …], } lucene.keyword { “Planes, Trains & Automobiles” : [3, …] },
  • 24. #MDBLocal Querying and Analyzers search: { query: “planes trains”, path: “title” } term(“plane”) OR term(“train”) term: { query: “planws”, path: { value: “title”, multi: ”simple”}, fuzzy: {maxEdits: 1 } } Fuzzy(“planws”, maxEdits: 1) term: { query: “Planes(.*)”, path: { value: “title”, multi: ”keyword”}, regex: true} } Regex(“Planes(.*)”) lucene.keyword lucene.simple lucene.english
  • 25. #MDBLocal MongoDB Atlas FTS components mongod mongos mongot (NEW!) ● $searchBeta aggregation pipeline stage ● Talks mongodb wire protocol to mongot ● Shard aware implementation ● scatter-gather queries ● Based on Apache Lucene 8 ● Integrated into MongoDB Atlas ● Separate java process from mongod ● collocated with mongod
  • 26. #MDBLocal FTS Indexing: Initial Sync MongoDB Atlas Query Index Definition Automation Agent mongotmongod Collection Scan Complete!
  • 27. #MDBLocal FTS Indexing: Steady State Documents mongotmongod changestream MongoDB Atlas (per node) mongot watches the changestream continuously and updates the search index
  • 28. #MDBLocal Query Lifecycle Wire Protocol (over internet to MongoDB Atlas) aggregate([ {$searchBeta: { search: { path: “name”, query: “star wars” } }}] mongod Wire protocol (localhost) Lucene booleanQuery: (should (term(“name”, “star”), term(“name”, wars”)) search: { path: “name”, query: “star wars” } [ { _id: “123”,score: 1.23,highlights: […] }, {…}] { “name” : { “star” : [123,124], “wars” : [123,125,…] } } Lookup([{_id: “123”], {…}]) mongot db.col.aggregate([ {$searchBeta: { search: { path: “name”, query: “star wars” } }}]) app [ { _id: “123”, title: “Star Wars”}, {…}] MongoDB Atlas Host
  • 29. #MDBLocal Sharding • Merge • Sort by score mongos request result per shard per shard • Scatter/gather (each shard) mongot, mongod mongot, mongod Primary Secondaries Query
  • 31. #MDBLocal • Expanded data type support • Nums, dates, geo • Synonyms • Improved operators/syntax • Architecture/performance improvements 2019 Roadmap
  • 32. #MDBLocal Feedback Visit cloud.mongodb.com Please provide feedback using the link on the FTS page. We are listening!
  • 34. Key Takeaways Ø Apache Lucene 8 Ø Uses MongoDB Query Language Ø Wide variety of query operators – fuzzy, wildcard Ø Flexible Scoring and Highlights Ø Configurable Indexes Ø Saves you time!!!
  • 36. #MDBlocal Every session you rate enters you into a drawing for a gift card! https://www.surveymonkey.com/r/C8TFLRC MongoDB Atlas Full-Text Search Deep Dive