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

簡易アナライザ

simpleアナライザは、空白、句読点、1 桁以上の数字など、文字以外の文字を見つけた場合、テキストを検索可能なターム(トークン)に分割します。 すべてのテキストを小文字に変換します。

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

重要

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 simple 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フィールドでlionというタームを検索し、出力を 5 つの結果に制限します。

MongoDB Search では、lucene.simpleアナライザを使用して、titleフィールドのテキストに対して次の操作を実行してこれらのドキュメントが返されます。

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

  • 文字以外の文字がある場合はテキストを分割して個別のトークンを作成します。

The following table shows the tokens that MongoDB Search creates for each document in the results using the Simple Analyzer. For comparison, the table also shows tokens from the Standard Analyzer and Whitespace Analyzer:

タイトル
簡易アナライザ トークン
標準アナライザ トークン
空白アナライザ トークン

White Lion

white, lion

white, lion

White, Lion

The Lion King

the, lion, king

the, lion, king

The, Lion, King

The Lion King 1 1/2

the, lion, king

the, lion, king, 1, 1, 2

The, Lion, King, 1, 1/2

Lion's Den

lion, s, den

lion's, den

Lion's, Den

MongoDB Search は、simple アナライザが lion の個別のトークンを作成し、それがクエリ期間 lion と一致するため、結果にドキュメント Lion's Den を返します。対照的に、Standard Analyzer または Whitespace Analyzer を使用してフィールドにインデックスを付ける場合、MongoDB Search は Lion's Den を返しません。標準アナライザはトークン lion's を作成し、空白アナライザは Lion's を作成しますが、どちらも lion のトークンは作成しません。

このページを評価