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

ホワイトスペースアナライザ

whitespaceアナライザは、空白文字を見つけるたびにテキストを検索可能なターム(トークン)に分割します。 すべてのテキストは元の文字大文字と小文字のままになります。

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

重要

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 whitespace 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'sというタームを検索します。

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

  • テキストの元の文字大文字と小文字を保持します。

  • 空白文字が見つかったテキストをトークンに分割します。

次の表は、 MongoDB Search が結果内のドキュメントに対して ホワイトスペース アナライザ と 単純アナライザ および キーワード アナライザ を使用して作成するトークン(検索可能なターム)を示しています。

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

The Lion's Mouth Opens

The, Lion's, Mouth, Opens

the, lion, s, mouth, opens

The Lion's Mouth Opens

whitespaceアナライザを使用するインデックスは大文字と小文字を区別します。したがって、 MongoDB Search はクエリタームLion's を whitespaceアナライザによって作成されたトークン Lion's と照合できます。

このページを評価