Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions docs/overview-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Search overview

Percona Server for MongoDB supports **Full-text Search** and **Vector Search** through `mongot`, a dedicated search service that works alongside `mongod`. Together, they enable applications to perform keyword-based, semantic, and AI-powered searches without moving data to an external search platform.

You can create search indexes on your collections and use aggregation pipeline stages such as `$search`, `$searchMeta`, and vector similarity queries to retrieve relevant results.

`mongot` is included with Percona Server for MongoDB and is available in binary distributions and installation packages.

## What is mongot?

[mongot :octicons-link-external-16:](https://www.mongodb.com/docs/manual/tutorial/mongot-sizing/advanced-guidance/architecture/){:target="_blank"} is a companion process that builds and maintains search indexes for your MongoDB collections. While mongod stores and manages your application data, `mongot` creates optimized search indexes and processes search queries.

The two services communicate internally during query execution:

- `mongod` stores documents and handles database operations.
- `mongot` maintains search indexes.
- Search queries are processed by `mongot`, while mongod retrieves the matching documents and returns the results to the client.

This architecture separates search workloads from core database operations while keeping the indexed data synchronized with the database.


## Search types

Percona Server for MongoDB supports the following search types. Choose the type that matches your query patterns:

| **Search type** | **Query stages**| **Index type** | **Use for**|
|------------------|-----------------|----------------|------------|
| Full-text search | `$search`, `$searchMeta` | `search`| Relevance-ranked text queries, autocomplete, faceting, and highlighting |
| Vector search | `$vectorSearch`| `vectorSearch` | Semantic similarity queries using machine learning embeddings|


### Full-text search

Full-text Search lets you search text stored in one or more fields using relevance-based ranking. It supports capabilities such as:

- Keyword and phrase searches
- Boolean operators
- Fuzzy matching
- Wildcard searches
- Field-specific searches
- Relevance scoring

Use cases include:

- Product catalog search
- Documentation search
- Blog and article search
- Customer support knowledge bases


For information about the search architecture and the eventual consistency model, see Search in Percona Server for MongoDB.

33 changes: 33 additions & 0 deletions docs/vector-search-architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Architecture

`mongod` and `mongot` work together to provide full text and vector search capabilities. While `mongod` continues to store and manage your application data, mongot is responsible for building search indexes and executing search queries. The two processes run alongside each other and communicate internally to keep search indexes synchronized with the underlying data.

![image](_images/vector-search.png)

## Components

| **Component** | **Description** |
|-----------|-------------|
| `Application` | Sends vector search requests using the `$vectorSearch` aggregation stage. |
| `mongod` | Stores application data, manages vector search indexes, forwards vector search requests to `mongot`, retrieves matching documents, and returns the final results. |
| `mongos` | Routes vector search requests to the appropriate shard in sharded deployments. |
| `mongot` | Builds and maintains vector indexes, synchronizes them with data stored in `mongod`, performs nearest-neighbor searches, and returns matching document identifiers with similarity scores. |
| Vector indexes | Specialized indexes maintained by `mongot` to efficiently perform semantic similarity searches over vector embeddings. |

## How vector search works

The following steps describe how a vector search request is processed:
{.power-number}

1. The application converts the search query into a vector embedding using an embedding model.
2. The application submits the vector search request to `mongod` or `mongos` using the `$vectorSearch` aggregation stage.
3. `mongod` forwards the vector search portion of the request to `mongot`.
4. `mongot` searches the vector index for the nearest matching embeddings. The vector indexes are continuously synchronized with the data stored in mongod, ensuring that search results reflect the latest changes.
5. `mongot` returns the matching document identifiers and similarity scores to `mongod`.
6. `mongod` retrieves the corresponding documents from the database, applies any remaining aggregation pipeline stages, and returns the final results to the application.

## Data synchronization
`mongot` does not store the primary copy of your data. Instead, it maintains vector indexes that are synchronized with the collections stored in `mongod`. Whenever documents are inserted, updated, or deleted, the corresponding vector indexes are updated automatically. This synchronization ensures that vector search queries operate on current data without requiring manual index maintenance.



2 changes: 2 additions & 0 deletions mkdocs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ nav:
- Feature comparison with MongoDB: comparison.md
- Storage:
- "Percona Memory Engine": "inmemory.md"
- Search:
- overview-search.md
- Backup:
- "Hot Backup": "hot-backup.md"
- backup-cursor.md
Expand Down