AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。
Docs Menu

標準アナライザ

standardアナライザは、すべてのMongoDB Search インデックスとクエリのデフォルトです。テキストを単語の境界に基づいてタームに分割するため、ほとんどのユースケースで言語に依存しません。すべてのタームが小文字に変換され、句読点が削除されます。これは、メールアドレス、頭字語、中国語、日が照合、文字、英数字などを認識する文字列ベースのトークン化を提供します。

Refine Your Index を選択した場合、Atlas UI はIndex Configurations セクション内に View text analysis of your selected index configuration というタイトルのセクションを表示します。このセクションを展開すると、Atlas UI には、standardアナライザが各サンプル列に対して生成するインデックスと検索トークンが表示されます。 Atlas UI Visual Editor でインデックスを作成または編集すると、standardアナライザが組み込みサンプルドキュメントとクエリ文字列用に作成するトークンが確認できます。

重要

MongoDB Search は、アナライザトークンのサイズが 32766 バイトを超える、string フィールドのインデックスません。キーワードアナライザを使用している場合、32766 バイトを超える string フィールドはインデックス化されません。

The following example index definition specifies an index on the title field in the sample_mflix.movies collection using the standard analyzer. To follow along with this example, load the sample data on your cluster and either use mongosh or navigate to the Create a Search Index page in the Atlas UI following the steps in the Create a MongoDB Search Index tutorial.

Then, using the movies collection as your data source, follow the example procedure to create an index from mongosh or the Atlas UI Visual Editor or JSON editor.


➤ 言語を選択 ドロップダウン メニューを使用して、このページの例のインターフェイスを設定します。


次のクエリは、 titleフィールドでactionというタームを検索し、出力を 2 つの結果に制限します。

MongoDB Search がこれらのドキュメントを返すのは、クエリタームaction とドキュメントのトークン action が一致しているためです。MongoDB Searchはlucene.standardアナライザを使用して、titleフィールドのテキストに対して次の操作を実行して作成しました。

  • テキストを小文字に変換します。

  • 単語の境界に基づいてテキストを分割し、個別のトークンを作成します。

The following table shows the tokens (searchable terms) that MongoDB Search creates using the Standard Analyzer and, by contrast, the tokens that MongoDB Search creates for the Keyword Analyzer and Whitespace Analyzer for the documents in the results:

タイトル
標準アナライザ トークン
キーワード アナライザ トークン
空白アナライザ トークン

Action Jackson

action, jackson

Action Jackson

Action, Jackson

Class Action

class, action

Class Action

Class, Action

次のインデックスを使用してフィールドをインデックスする場合:

  • キーワード アナライザ、MongoDB Search では、クエリタームaction の結果内のドキュメントが一致しません。keywordアナライザは、検索タームがフィールドの内容全体に一致するドキュメントのみと一致するためです(Action Jackson と Class Action )を含むドキュメントをインポートしようとすると、エラーを返します。

  • ホワイトスペース アナライザ、 MongoDB Searchaction whitespacetitleActionactionwhitespaceでは、クエリターム のアナライザ内のドキュメントが アナライザトークンと一致しない 。

このページを評価

項目一覧