このドキュメントでは、 MongoDB ベクトル検索の問題をトラブルシューティングするためのアドバイスを提供します。 MongoDB ベクトル検索 の問題を直接サポートするには、 Reddit またはStack OverflowのMongoDBコミュニティでディスカッションを開始するか、 サポートにお問い合わせください 。
クラスターでは $vectorSearch ステージは使用できません
$vectorSearchパイプラインステージを使用してクラスターをクエリするには、クラスターでMongoDB 7.0.2+ を実行する必要があります。互換性のないバージョンのMongoDBで $vectorSearch を呼び出すと、次のエラーが表示される場合があります。
OperationFailure: $vectorSearch is not allowed with the current configuration. You may need to enable the corresponding feature flag.
クラスターの MongoDB バージョンを確認するには:
Atlas で、プロジェクトの Clusters ページに移動します。
まだ表示されていない場合は、希望するプロジェクトを含む組織を選択しますナビゲーション バーのOrganizationsメニュー
まだ表示されていない場合は、ナビゲーション バーのProjectsメニューから目的のプロジェクトを選択します。
サイドバーで、 Database見出しの下のClustersをクリックします。
[ Clusters (クラスター) ] ページが表示されます。
$vectorSearchを使用するクラスターの情報ペインを見つけます。
情報ペインの下部のセクションでVersionの数字を確認します。
If your cluster runs a version of MongoDB earlier than 6.0.11 or 7.0.2, you must upgrade the MongoDB version of the cluster.
低速クエリ
クエリ パフォーマンスの向上に関する推奨事項については、 MongoDB ベクトル検索のベンチマーク を参照してください。
$vectorSearch は結果を返しません
$vectorSearch クエリで結果が返されない場合は、次のアクションを実行します。
データとクエリの両方に同じ埋め込みモデルを使用していることを確認します。 データの埋め込みに使用するモデルとは異なるモデルを使用してクエリを埋め込んだ場合、
$vectorSearchは一致を識別できません。Ensure that your MongoDB Vector Search has finished building. When you create or update a MongoDB Vector Search index, the index the index is in an initial sync state. When it finishes building, you can start querying the data in your collection.
Error during document retrieval LgChuin でフィルタリングを使用する場合
LangChain を使用して RAG を事前フィルタリングで実行すると、次のエラーが発生する可能性があります。
Error during the document retrieval or generation process: MongoServerError: PlanExecutor error during aggregation :: caused by :: Path 'field' needs to be indexed as token
If an index on field exists, ensure you have created this index as a MongoDB Vector Search index, not a MongoDB Search index. If no index on field exists, create one. To learn more about implementing RAG with MongoDB Vector Search and LangChain, see Answer Questions on Your Data.
Command not found MongoDB ベクトル検索インデックスの作成時
MongoDB ベクトル検索インデックスをプログラムで作成しようとすると、Command not found エラーが発生する可能性があります。このエラーは、次の 2 つの理由のいずれかで発生します。
You run the command against a cluster running a version of MongoDB earlier than 6.0.11 or 7.0.2. In this case, you must upgrade the MongoDB version of the cluster to enable MongoDB Vector Search for the cluster.
無料クラスター(以前は
M0と呼ばれていました)に対して コマンドを実行します。この場合、クラスターが互換性のあるMongoDBバージョンを実行中いる限り、Atlas UIを使用してMongoDB ベクトル検索インデックスを作成できます。
指定されたフィールドでフィルタリングできません
MongoDB ベクトル検索 は現在、ブール値、日付、数値、ObjectId、string、および UUID 値を持つフィールドのみのフィルタリングをサポートしています。 詳しくは、「 filter 型について 」を参照してください。