Atlas Search の概要
項目一覧
What is Atlas Search?
Atlas Search is an embedded full-text search that gives you a seamless, scalable experience for building relevance-based app features and eliminates the need to run a separate search system alongside your database.
You can use Atlas Search for fine-grained text indexing and querying of data on your cluster. Atlas Search provides several kinds of text analyzers, a rich query language to create complex search logic, customizable score-based results ranking, and advanced search features for your applications like autocomplete, pagination, and faceting.
ユースケース
Atlas Search supports diverse use cases including the following:
Search-as-you-type: To predict words with increasing accuracy as users enter characters in your application's search field, you can use the Atlas Search オートコンプリート operator to predict and return results for partial words. To learn more, see How to Run Autocomplete and Partial Match Atlas Search Queries.
Faceted Search: To enable users of your application to narrow down search results through the use of filters, you can use the Atlas Search facet collector to build facets that group results by values or ranges in the faceted fields. To learn more, see How to Use Facets with Atlas Search.
Paginated Results: To group pages of results and implement functions like "Next Page" and "Previous Page", you can use the Atlas Search
searchSequenceToken
withsearchAfter
andsearchBefore
options to traverse pages in-order and jump across pages. To learn more, see How to Paginate the Results.
重要な概念
以下の概念はAtlas Search の基礎を形成し、アプリケーションを最適化するために不可欠です。
What are search queries?
Search queries consult a search index to return a set of results. Search queries are different than traditional database queries, as they are intended to meet more general information needs. Where a database query must follow a strict syntax, search queries can be used for simple text matching, but can also look for similar phrases, number or date ranges, or use regular expressions or wildcards.
Atlas Search queries take the form of an aggregation pipeline stage. Atlas Search provides $search
and
$searchMeta
stages, which can be used in conjunction with
other aggregation pipeline stages in your query
pipeline. Atlas Search provides query operators and
collectors that you can use inside these
aggregation pipeline stages.
To learn more, see Queries and Indexes.
What is a search index?
インデックスとは、検索で使用する場合、簡単に検索可能な形式でデータを分類するデータ構造です。検索インデックスを利用すると、コレクション全体をスキャンする必要なしに、指定タームを含むドキュメントをすばやく取得できます。Atlas Search インデックスと MongoDB インデックス はいずれもデータの取得を迅速化しますが、同じものではないことに注意してください。検索インデックスは、本の末尾の索引のようにタームとそのタームを含むドキュメントを紐付けします。検索インデックスには、ドキュメント内のタームの位置付けなど、他の関連メタデータも含まれます。
You can create an Atlas Search index on a single field or on multiple fields by using static mappings. Alternatively, you can enable dynamic mappings to automatically index all the dynamically indexable fields in your documents. You can create Atlas Search indexes on polymorphic data and embedded documents, or for specific use-cases like search-as-you-type or faceted search.
To learn more, see Manage Atlas Search Indexes.
What are search analyzers and tokens?
検索インデックスを作成する際は、データをまず一連のトークンまたはタームに変換する必要があります。アナライザが次のようなステップを通じてこのプロセスを促進します。
トークン化: 文字列内の単語をインデックスを作成可能なトークンに分割します。たとえば、空白と句読点で文章を区切ります。
正規化: 表現を一貫させ、簡単に分析できるようにデータを整理します。たとえば、テキストを小文字に変換したり、ストップワードと呼ばれる不要な単語を削除したりします。
ステミング: 単語を語幹形態まで縮小します。たとえば、接尾辞、接頭辞、複数形の語形を無視します。
The specifics of tokenization are language-specific and can require making additional choices. Which analyzer to use depends on your data and application.
Atlas Search provides some built-in analyzers. You can also create your own custom analyzer. You can specify alternate analyzers using multi analyzer.
To learn more, see アナライザによるデータ処理.
What is a search score?
Each document in the query results receives a relevancy score that enables query results to be returned in order from the highest relevance to the lowest. In the simplest form of scoring, documents score higher if the query term appears frequently in a document and lower if the query term appears across many documents in the collection. Scoring can also be customized. Tailoring search to a specific domain often means customizing the relevance-based default score by boosting, decaying, or modifying it in other ways.
To learn more, see Score Documents.
次のステップ
For a hands-on experience creating Atlas Search indexes and running Atlas Search queries against sample data, try the Atlas Search Quick Start.