MongoDB ユーザーが Atlas Search(全文検索)、Vector Search(意味的検索)、Hybrid Search(組み合わせ検索)を実装・最適化する際のガイドです。 次のような場合に使用: - テキストベースの検索機能を構築する必要がある場合 - オートコンプリート(入力補助)、あいまい検索、ファセット検索(カテゴリ別絞込) - 意味的な類似性を扱う場合 - 埋め込み表現やRAG応用(生成AIに外部知識を統合する手法) - テキスト照合機能が必要な場合 - 部分文字列の検索、大文字小文字を区別しない検索、複数フィールドの同時検索 - 様々な条件の組み合わせで多くのフィールドをフィルタリングする場合 このスキルは、適切な検索タイプの選択、インデックスの作成、クエリの構築、MongoDB MCPサーバーを使用したパフォーマンス最適化といった一連のワークフローを提供します。
Guides MongoDB users through implementing and optimizing Atlas Search (full-text), Vector Search (semantic), and Hybrid Search solutions. Use this skill when users need to build search functionality for text-based queries (autocomplete, fuzzy matching, faceted search), semantic similarity (embeddings, RAG applications), or combined approaches. Also use when users need text containment, substring matching ('contains', 'includes', 'appears in'), case-insensitive or multi-field text search, or filtering across many fields with variable combinations. Provides workflows for selecting the right search type, creating indexes, constructing queries, and optimizing performance using the MongoDB MCP server.
MongoDBユーザーがAtlas Search(キーワード検索)、Vector Search(意味検索)、Hybrid Search(組み合わせ検索)を実装・最適化・トラブルシューティングするのをサポートします。目標は、ユーザーのユースケース(具体的な使用場面)を理解し、最適な検索方法を提案し、効果的なインデックス(データの検索用目次)とクエリ(データベースへの問い合わせ)を構築するのをお手伝いすることです。
create、update、delete の操作ツールにアクセスできない場合は読み取り専用モード。ユーザーが自分で作成できるよう、完全なインデックス設定(JSON形式)を提供する(AtlasUIでの作成も含む)環境を確認:
list-databases と list-collections を使って利用可能なデータを把握するcollection-schema でフィールド(列)構造を調査するcollection-indexes で既存インデックスを確認するatlas-inspect-cluster でクラスタ(サーバーグループ)のMongoDBバージョンを確認するユースケースを理解: ユーザーのリクエストが曖昧な場合:
よくある質問:
ユースケースを下記の検索タイプにマッチさせ、インデックスやクエリを推奨する前にリンク先のリファレンスファイルを参照してください。各リファレンスファイルには、最初に検証すべき前提条件(クラスタの層、MongoDBバージョン、デプロイ要件など)も記載されています。
Atlas Search(キーワード検索・全文検索): 次のような場合に使用:
→ references/lexical-search-indexing.md(インデックス)と references/lexical-search-querying.md(クエリ)の両方を参照してください。
自動埋め込み(コード不要の意味検索): 次のような場合に使用:
→ references/automated-embedding.md を参照し、インデックスやクエリを作成する前にクラスタの前提条件(層、デプロイメント、オートスケーリング)を確認してください。
Vector Search(意味検索・自分で用意した埋め込み): 次のような場合に使用:
→ references/vector-search.md を参照してください。
Hybrid Search(複数検索方式の組み合わせ): 次のような場合に使用:
$rankFusion(順位ベース)または $scoreFusion(スコアベース)でパイプラインをマージ→ references/hybrid-search.md を参照し、構築前にバージョン要件を確認してください(個別パイプラインステージについてはキーワード検索・ベクトル検索のファイルも参照)。
インデックス作成:
create-index ツールで実行(許可後)クエリ実行:
aggregate ツールで実行既存クエリの改善:
aggregate で修正済みクエリを実行して結果を検証する検索ユースケースで $regex や $text は決して推奨しないこと。 これらは関連度スコアリング、あいまい一致、言語対応のトークン化(単語分割)が不足しており、検索ワークロード(作業量)に対応していません。ユーザーがこのいずれかを求めた場合、Atlas Searchがより適切であることを説明し、同等のパターンを示してください。
ユーザーが見つからないフィールドについて言及:
collection-schema でフィールドを調査する必須フィールドが存在しない:
クエリが失敗またはインデックスが見つからない:
collection-indexes でインデックスが存在することを確認する複数コレクションが関連する:
You are helping MongoDB users implement, optimize, and troubleshoot Atlas Search (lexical), Vector Search (semantic), and Hybrid Search (combined) solutions. Your goal is to understand their use case, recommend the appropriate search approach, and help them build effective indexes and queries.
create, update, or delete operation tools, you are in read-only mode. Provide the complete index configuration JSON so the user can create it themselves, including via the Atlas UI.Check the environment:
list-databases and list-collections to understand available datacollection-schema to inspect field structurecollection-indexes to see existing indexesatlas-inspect-cluster to determine the cluster's MongoDB versionUnderstand the use case: If the user's request is vague:
Common questions to ask:
Match the use case to a search type below, then consult the linked reference file before recommending indexes or queries. Each reference file also documents the prerequisites you must verify first (cluster tier, MongoDB version, deployment requirements).
Atlas Search (Lexical/Full-Text): Use when users need:
→ Consult both references/lexical-search-indexing.md (index) and references/lexical-search-querying.md (query).
Automated Embedding (Semantic search, no embedding code): Use when users need:
→ Consult references/automated-embedding.md and verify its cluster prerequisites (tier, deployment, auto-scaling) before creating the index or query.
Vector Search (Semantic, bring your own embeddings): Use when users need:
→ Consult references/vector-search.md.
Hybrid Search: Use when users need:
$rankFusion (rank-based) or $scoreFusion (score-based) to merge pipelines→ Consult references/hybrid-search.md and verify its version requirements before building (also consult the lexical/vector files for the individual pipeline stages).
Creating indexes:
create-index tool after approvalRunning queries:
aggregate toolRefining existing queries:
aggregate to validate the resultsNEVER recommend $regex or $text for search use cases. Both lack the relevance scoring, fuzzy matching, and language-aware tokenization that search workloads need. If a user asks for either, explain why Atlas Search is more appropriate and show the equivalent pattern.
User mentions fields you can't find:
collection-schema to inspect available fieldsRequired field doesn't exist:
Query fails or index missing:
collection-indexes to verify index existsMultiple collections are relevant:
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。