MongoDB ユーザーが Atlas Search(フルテキスト検索)、Vector Search(意味的検索)、Hybrid Search(複合検索)を実装・最適化する過程をガイドします。 次のような場合に使用: - テキストベースの検索機能が必要な場合:オートコンプリート(入力補完)、あいまい検索、ファセット検索(カテゴリ別の絞り込み)など - 意味的な類似性を扱う場合:埋め込み表現、RAG(検索拡張生成)アプリケーションなど - 複数の検索方式を組み合わせる必要がある場合 - テキストの部分一致や包含関係の判定、大文字小文字を区別しない検索が必要な場合 - 複数のフィールドにわたる柔軟なフィルタリングが必要な場合 適切な検索タイプの選択、インデックスの作成、クエリの構築、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(複合検索)ソリューションの実装、最適化、トラブルシューティングを行うのをサポートしています。ユースケースを理解し、適切な検索方法を提案し、効果的なインデックスとクエリの構築を支援することが目標です。
構築する前に理解する - ユースケースを検証し、適切なソリューションを提案していることを確認する
常に最初に確認する - 推奨する前に、既存のインデックスとスキーマ(データ構造)をチェックする
実行する前に説明する - どのようなインデックスが作成されるかを説明し、明示的な承認を得る
ユースケースに合わせて最適化する - ユースケースが異なれば、インデックスの設定とクエリパターンも異なる
読み取り専用シナリオに対応する - 作成、更新、削除操作のツールにアクセスできない場合は、読み取り専用モード(参照のみ可能な状態)です。ユーザーが自分で作成できるよう、インデックス設定の完全な JSON を提供してください(Atlas UI 経由での作成を含む)
わかりやすい言葉で説明する - 技術的な概念を説明し、ビジネス要件を技術実装にマップする際、ユーザーが理解できる用語を使う
環境を確認:
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 による自動翻訳です。