クエリプランと実行統計の取得
項目一覧
Atlas Search$search
explain
クエリは、explain
メソッドを有効にしてクエリを実行すると、 クエリプランと実行統計に関する情報を返します。 を使用してクエリを実行すると、Atlas Search は、クエリが Lucene の内部で実行された方法を説明する統計とメタデータを含む BSONドキュメントを返します。
構文
db.<myCollection>.explain("<verbosity>").aggregate([ { $search: { "<operator>": { "<operator-options>" } } } ])
冗長
冗長モードは、 explain
の動作と返される情報の量を制御します。 値は次のいずれかになります。
クエリの実行統計を含む | |
クエリの実行統計を含む | |
queryPlanner (デフォルト) | クエリプランに関する情報。クエリの実行統計を含む |
explain の結果
explain
の結果は、次のフィールドを含むBSONドキュメントです。
オプション | タイプ | 必要性 | 目的 |
---|---|---|---|
| ドキュメント | 任意 | コレクターの実行統計を説明します。 |
| ドキュメント | 任意 | クエリの のハイライト実行に関する詳細。これは、クエリで 強調表示 を指定した場合にのみ返されます。 |
| ドキュメントの配列 | 任意 | インデックスパーティションごとの詳細が含まれます。これは、2 つ以上のインデックスパーティションを構成した場合にのみ返されます。 |
| ドキュメント | 任意 | 便利なメタデータが含まれています。 |
| ドキュメント | 任意 | クエリの実行統計を記述します。これは |
| ドキュメント | 任意 | クエリの実行後に Lucene からドキュメントごとのデータを取得するために関連する詳細。これは、 |
| ドキュメント | 任意 | クエリの実行時におけるクエリのリソース使用量を表示します。これは、 |
collectors
collectors
は、次のフィールドを含むBSONドキュメントです。
オプション | タイプ | 必要性 | 目的 |
---|---|---|---|
| ドキュメント | 必須 | クエリのすべてのコレクターの統計情報。統計はクエリで使用されるすべてのコレクターにわたる最大値を表し、すべてのサブコレクションの合計です。タイミング統計は、クエリ全体のすべてのコレクターで費やされた合計時間を反映するように合計されます。詳しくは |
| ドキュメント | 任意 | ファセットを指定するクエリの内訳。詳しくは |
| ドキュメント | 任意 | ソート を指定するクエリの内訳詳しくは |
allCollectorStats
allCollectorStats
は、クエリで指定されたすべてのコレクター( facet
と を含む)のコレクター統計を記述するBSONドキュメントです。これには、次のキーが含まれています。sort
| は、コレクターによって収集された結果の期間と数を追跡します。 |
| 合計期間と、コレクターから |
| コレクターでスコアラーが設定された合計期間と回数を追跡する統計。 |
facet
facet
は、クエリでファセットを指定した場合のクエリと実行の統計を詳細するBSONドキュメントです。これには、次のフィールドが含まれています。
オプション | タイプ | 必要性 | 目的 |
---|---|---|---|
| ドキュメント | 任意 |
|
| ドキュメント | 任意 | すべてのファセットグループを保持する内部 Luceneオブジェクトの作成に関連する統計を表示します。これには |
| ドキュメント | 必須 | フィールドを、クエリに一致したドキュメントおよび Luceneインデックス全体の両方の濃度にマッピングします。これにより、各フィールドについて次の濃度情報が提供されます。
|
sort
sort
は、クエリで並べ替えを指定した場合のクエリと実行に関する統計を詳細化するBSONドキュメントです。これには、次のフィールドが含まれています。
オプション | タイプ | 必要性 | 目的 |
---|---|---|---|
| ドキュメント | 任意 | すべての並べ替えフィールドにわたって
|
| ドキュメント | 必須 | ソートされているフィールドを、フィールドのインデックスに存在するデータ型のリストにマッピングします。 |
highlight
highlight
は、クエリで を強調表示することで、クエリと実行の統計を詳細に表示するBSONドキュメントです。これには、次のフィールドが含まれています。
オプション | タイプ | 必要性 | 目的 |
---|---|---|---|
| List<String> | 必須 | 強調表示されたすべてのフィールドのリスト。クエリの |
| QueryExecutionArea | 任意 | ハイライトのセットアップと実行に関連する呼び出しとタイミングの統計情報。これには、次のフィールドが含まれています。
|
indexPartitionExplain
indexPartitionExplain
には、各インデックスパーティションの説明結果が含まれています。最上位のcollectors
とquery
は各インデックスパーティションのexplain
情報内にあり、最上位には存在しません。
metadata
metadata
には、次のような役立つメタデータが含まれています。
オプション | タイプ | 必要性 | 目的 |
---|---|---|---|
| 文字列 | 任意 |
|
| 文字列 | 任意 |
|
| 文字列 | 任意 | クエリで使用される Atlas Searchインデックス。 |
| ドキュメント | 任意 | mongot に指定されたカーソル オプション。 |
| 整数 | 任意 | 削除されたドキュメントを含む、インデックス内の lucene ドキュメントの合計数。 |
query
explain
応答は、クエリの実行統計を説明するキーと値を含むBSONドキュメントです。 結果セット内のexplain
ドキュメントには、次のフィールドが含まれています。
オプション | タイプ | 必要性 | 目的 |
---|---|---|---|
| string | 任意 | 演算子へのパス(ルートでない場合のみ)。 |
| string | 必須 | Atlas Search 演算子が作成した Lucene クエリの名前。詳しくは、 |
| string | 任意 | クエリで使用される Atlas Searchアナライザ。 |
| ドキュメント | 必須 | Lucene クエリ情報。詳しくは、 |
| ドキュメント | 任意 | が または |
args
検索コマンドの explain 応答には、そのコマンドで実行されたクエリに関する情報が含まれます。args
フィールドの応答には、Atlas Search が クエリを満たすために実行した Lucene$search
クエリの構造化された詳細が含まれます。
このセクションには、次の内容が含まれます。
Atlas Search 演算子が作成する Lucene クエリの一部
構造化サマリーに含まれる Lucene クエリ オプション
各 Lucene クエリ タイプの Lucene クエリ構造の概要の例
注意
例について
ConstantScoreQuery
定数スコアクエリの場合、構造化されたサマリーには次のオプションの詳細が含まれます。
フィールドタイプ必要性説明query
必須
ConstantScoreQuery
の子。次の例では、
sample_airbnb.listingsAndReviews
コレクションに対してクエリを実行した場合のexplain
応答を示しています。1 { 2 "stages" : [ 3 { 4 "$_internalSearchMongotRemote" : { 5 "mongotQuery" : { 6 "equals" : { 7 "path" : "host.host_identity_verified", 8 "value" : true 9 } 10 }, 11 "explain" : { 12 "type" : "ConstantScoreQuery", 13 "args" : { 14 "query" : { 15 "type" : "TermQuery", 16 "args" : { 17 "path" : "host.host_identity_verified", 18 "value" : "T" 19 } 20 } 21 } 22 } 23 } 24 }, 25 { 26 "$_internalSearchIdLookup" : { } 27 } 28 ], 29 ... 30 }
FunctionScoreQuery
Lucene
FunctionScoreQuery
クエリの場合、構造化されたサマリーには次のオプションに関する詳細が含まれます。フィールドタイプ必要性説明scoreFunction
string
必須
クエリで使用される スコア式 。
query
必須
クエリ。
次の例では、
sample_airbnb.listingsAndReviews
コレクションに対してクエリを実行した場合のexplain
応答を示しています。1 { 2 "stages" : [ 3 { 4 "$_internalSearchMongotRemote" : { 5 "mongotQuery" : { 6 "near" : { 7 "path" : "accomodates", 8 "origin" : 8, 9 "pivot" : 2 10 } 11 }, 12 "explain" : { 13 "type" : "BooleanQuery", 14 "args" : { 15 "must" : [ ], 16 "mustNot" : [ ], 17 "should" : [ 18 { 19 "type" : "BooleanQuery", 20 "args" : { 21 "must" : [ ], 22 "mustNot" : [ ], 23 "should" : [ 24 { 25 "type" : "FunctionScoreQuery", 26 "args" : { 27 "scoreFunction" : "expr(pivot / (pivot + abs(origin - value)))", 28 "query" : { 29 "type" : "LongDistanceFeatureQuery", 30 "args" : { }, 31 "stats" : { } 32 } 33 } 34 } 35 ], 36 "filter" : [ 37 { 38 "type" : "PointRangeQuery", 39 "args" : { 40 "path" : "accomodates", 41 "representation" : "double", 42 "gte" : 8.000000000000002, 43 "lte" : NaN 44 } 45 } 46 ], 47 "minimumShouldMatch" : 0 48 } 49 }, 50 { 51 "type" : "LongDistanceFeatureQuery", 52 "args" : { }, 53 "stats" : { } 54 } 55 ], 56 "filter" : [ ], 57 "minimumShouldMatch" : 0 58 } 59 } 60 }, 61 ... 62 }, 63 ... 64 ], 65 ... 66 }
LatLonPointDistanceQuery
Lucene
LatLonPointDistanceQuery
クエリの場合、応答にはstats
のみが含まれます。次の例では、
sample_airbnb.listingsAndReviews
コレクションに対してクエリを実行した場合のexplain
応答を示しています。1 { 2 "stages" : [ 3 { 4 "$_internalSearchMongotRemote" : { 5 "mongotQuery" : { 6 "geoWithin" : { 7 "path" : "address.location", 8 "circle" : { 9 "radius" : 4800, 10 "center" : { 11 "type" : "Point", 12 "coordinates" : [ 13 -122.419472, 14 37.765302 15 ] 16 } 17 } 18 } 19 }, 20 "explain" : { 21 "type" : "LatLonPointDistanceQuery", 22 "args" : { } 23 } 24 } 25 }, 26 ... 27 ], 28 ... 29 }
LatLonShapeQuery
Lucene
LatLonShapeQuery
クエリの場合、応答にはstats
のみが含まれます。次の例では、
sample_airbnb.listingsAndReviews
コレクションに対してクエリを実行した場合のexplain
応答を示しています。1 { 2 "stages" : [ 3 { 4 "$_internalSearchMongotRemote" : { 5 "mongotQuery" : { 6 "geoShape" : { 7 "path" : "address.location", 8 "relation" : "within", 9 "geometry" : { 10 "type" : "Polygon", 11 "coordinates" : [ 12 [ 13 [ -74.3994140625, 40.5305017757 ], 14 [ -74.7290039063, 40.5805846641 ], 15 [ -74.7729492188, 40.9467136651 ], 16 [ -74.0698242188, 41.1290213475 ], 17 [ -73.65234375, 40.9964840144 ], 18 [ -72.6416015625, 40.9467136651 ], 19 [ -72.3559570313, 40.7971774152 ], 20 [ -74.3994140625, 40.5305017757 ] 21 ] 22 ] 23 } 24 } 25 }, 26 "explain" : { 27 "type" : "LatLonShapeQuery", 28 "args" : { } 29 } 30 }, 31 ... 32 }, 33 ... 34 ], 35 ... 36 }
LongDistanceFeatureQuery
Lucene
LongDistanceFeatureQuery
の場合、応答にはstats
のみが含まれています。次の例では、
sample_mflix.movies
コレクションに対してクエリを実行した場合のexplain
応答を示しています。1 { 2 "stages" : [ 3 { 4 "$_internalSearchMongotRemote" : { 5 "mongotQuery" : { 6 "near" : { 7 "path" : "released", 8 "origin" : ISODate("1915-09-13T00:00:00Z"), 9 "pivot" : 7776000000 10 } 11 }, 12 "explain" : { 13 "type" : "LongDistanceFeatureQuery", 14 "args" : { } 15 } 16 }, 17 ... 18 }, 19 ... 20 ], 21 ... 22 }
MultiTermQueryConstantScoreWrapper
次の例では、
sample_airbnb.listingsAndReviews
コレクションに対してクエリを実行した場合のexplain
応答を示しています。1 { 2 "stages" : [ 3 { 4 "$_internalSearchMongotRemote" : { 5 "mongotQuery" : { 6 "regex" : { 7 "path" : "access", 8 "query" : "full(.{0,5})", 9 "allowAnalyzedField" : true 10 } 11 }, 12 "explain" : { 13 "type" : "MultiTermQueryConstantScoreWrapper", 14 "args" : { 15 "queries" : [ 16 { 17 "type" : "DefaultQuery", 18 "args" : { 19 "queryType" : "RegexpQuery" 20 } 21 } 22 ] 23 } 24 } 25 }, 26 ... 27 }, 28 ... 29 ], 30 ... 31 }
PhraseQuery
Lucene
PhraseQuery
クエリの場合、構造化されたサマリーには次の引数に関する詳細が含まれます。フィールドタイプ必要性説明path
文字列
必須
検索するインデックス付きフィールド。
query
文字列
必須
検索する文字列または複数の文字列。
slop
番号
必須
query
フレーズ内の単語間の許容距離。次の例では、
sample_airbnb.listingsAndReviews
コレクションに対してクエリを実行した場合のexplain
応答を示しています。1 { 2 "stages" : [ 3 { 4 "$_internalSearchMongotRemote" : { 5 "mongotQuery" : { 6 "phrase" : { 7 "path" : "description", 8 "query" : "comfortable apartment", 9 "slop" : 2 10 } 11 }, 12 "explain" : { 13 "type" : "PhraseQuery", 14 "args" : { 15 "path" : "description", 16 "query" : "[comfortable, apartment]", 17 "slop" : 2 18 } 19 } 20 }, 21 ... 22 }, 23 ... 24 ], 25 ... 26 }
PointRangeQuery
Lucene
PointRangeQuery
クエリの場合、構造化されたサマリーには次の引数に関する詳細が含まれます。フィールドタイプ必要性説明path
文字列
必須
検索するインデックス付きフィールド。
representation
文字列
任意
数値表現。 日付型データに対するクエリには表現は含まれません。
gte
番号
任意
クエリの下限。
lte
番号
任意
クエリの上限。
次の例では、
sample_airbnb.listingsAndReviews
コレクションに対してクエリを実行した場合のexplain
応答を示しています。1 { 2 "stages" : [ 3 { 4 "$_internalSearchMongotRemote" : { 5 "mongotQuery" : { 6 "range" : { 7 "path" : "number_of_reviews", 8 "gt" : 5 9 } 10 }, 11 "explain" : { 12 "type" : "BooleanQuery", 13 "args" : { 14 "must" : [ ], 15 "mustNot" : [ ], 16 "should" : [ 17 { 18 "type" : "PointRangeQuery", 19 "args" : { 20 "path" : "number_of_reviews", 21 "representation" : "double", 22 "gte" : 5.000000000000001 23 } 24 }, 25 { 26 "type" : "PointRangeQuery", 27 "args" : { 28 "path" : "number_of_reviews", 29 "representation" : "int64", 30 "gte" : NumberLong(6) 31 } 32 } 33 ], 34 "filter" : [ ], 35 "minimumShouldMatch" : 0 36 } 37 } 38 }, 39 ... 40 }, 41 ... 42 ], 43 ... 44 }
TermQuery
ターム クエリの場合、構造化されたサマリーには次の引数に関する詳細が含まれます。
フィールドタイプ必要性説明path
文字列
必須
検索するインデックス付きフィールド。
value
文字列
必須
検索する string。
次の例では、
sample_airbnb.listingsAndReviews
コレクションに対してクエリを実行した場合のexplain
応答を示しています。1 { 2 "stages" : [ 3 { 4 "$_internalSearchMongotRemote" : { 5 "mongotQuery" : { 6 "queryString" : { 7 "defaultPath" : "summary", 8 "query" : "quiet" 9 } 10 }, 11 "explain" : { 12 "type" : "TermQuery", 13 "args" : { 14 "path" : "summary", 15 "value" : "quiet" 16 } 17 } 18 }, 19 ... 20 }, 21 ... 22 ], 23 ... 24 }
Default
別の Lucene クエリによって明示的に定義されていない Lucene クエリは、デフォルトのクエリを使用して直列化されます。 構造化されたサマリーには、次のオプションの詳細が含まれます。
フィールドタイプ必要性説明queryType
文字列
必須。
Lucene クエリのタイプ。
次の例では、
sample_airbnb.listingsAndReviews
コレクションに対してクエリを実行した場合のexplain
応答を示しています。1 { 2 "stages" : [ 3 { 4 "$_internalSearchMongotRemote" : { 5 "mongotQuery" : { 6 "near" : { 7 "origin" : { 8 "type" : "Point", 9 "coordinates" : [ 10 -8.61308, 11 41.1413 12 ] 13 }, 14 "pivot" : 1000, 15 "path" : "address.location" 16 } 17 }, 18 "explain" : { 19 "type" : "DefaultQuery", 20 "args" : { 21 "queryType" : "LatLonPointDistanceFeatureQuery" 22 } 23 } 24 }, 25 ... 26 }, 27 ... 28 ], 29 ... 30 }
stats
executionStats と allPlansExecution の冗長モードのexplain
レスポンスにはstats
、クエリ実行のさまざまな段階でクエリ に費やされた 時間 に関する情報を含む フィールドが含まれています。
タイミングの内訳
タイミングの内訳は、クエリ実行の領域に関連する実行統計を示します。 次のフィールドは、タイミングの内訳を示しています。
クエリの領域
統計は、クエリの次の領域で利用できます。
resultMaterialization
resultMaterialization
は、mongot
が次の操作を実行するのにかかる時間を追跡します。
_id
またはstoredSource
の形式で Lucene に保存されている結果データを取得します。に送信する前にデータをBSON形式にシリアル化します。
mongod
resourceUsage
resourceUsage
は、クエリの実行中に使用されるリソースを追跡します。これには、次のフィールドが含まれています。
オプション | タイプ | 必要性 | 目的 |
---|---|---|---|
| Long | 必須 | クエリの実行中に、システムがメモリ内に必要なデータを見つけられず、ディスクなどのバッキング ストアからの読み取りが発生した場合に発生する、メジャー ページ フォールトの数。 |
| Long | 必須 | マイナーなページ フォールトの数。データは ページキャッシュにあるが、プロセスのページ テーブルにまだマップされていない場合に発生します。 |
| Long | 必須 | ユーザー空間で費やされたCPU時間の量(ミリ秒単位)。 |
| Long | 必須 | システム空間で費やされたCPU時間の量(ミリ秒単位)。 |
| 整数 | 必須 | すべてのバッチでクエリ実行中に |
| 整数 | 必須 | クエリの処理中に |
例
次の例えでは、sample_mflix
データベースの movies
コレクションを使用します。
Tip
サンプル データセットをすでに読み込んでいる場合は、「Atlas Search スタートガイド」チュートリアルに従って、インデックスの定義を作成し、Atlas Search クエリを実行します。
allPlansExecution
次の例では、さまざまな演算子を使用して、title
allPlansExecution
冗長モードで フィールドをクエリします。
db.movies.explain("allPlansExecution").aggregate([ { $search: { "text": { "path": "title", "query": "yark", "fuzzy": { "maxEdits": 1, "maxExpansions": 100, } } } } ])
1 { 2 explainVersion: '1', 3 stages: [ 4 { 5 '$_internalSearchMongotRemote': { 6 mongotQuery: { 7 text: { 8 path: 'title', 9 query: 'yark', 10 fuzzy: { maxEdits: 1, maxExpansions: 100 } 11 } 12 }, 13 explain: { 14 query: { 15 type: 'BooleanQuery', 16 args: { 17 must: [], 18 mustNot: [], 19 should: [ 20 { 21 type: 'BoostQuery', 22 args: { 23 query: { 24 type: 'TermQuery', 25 args: { path: 'title', value: 'dark' }, 26 stats: { 27 context: { millisElapsed: 0 }, 28 match: { millisElapsed: 0 }, 29 score: { millisElapsed: 0 } 30 } 31 }, 32 boost: 0.75 33 }, 34 stats: { 35 context: { 36 millisElapsed: 0.403983, 37 invocationCounts: { 38 createWeight: Long('1'), 39 createScorer: Long('18') 40 } 41 }, 42 match: { 43 millisElapsed: 0.094254, 44 invocationCounts: { nextDoc: Long('89') } 45 }, 46 score: { 47 millisElapsed: 0.077043, 48 invocationCounts: { score: Long('83') } 49 } 50 } 51 }, 52 { 53 type: 'BoostQuery', 54 args: { 55 query: { 56 type: 'TermQuery', 57 args: { path: 'title', value: 'ark' }, 58 stats: { 59 context: { millisElapsed: 0 }, 60 match: { millisElapsed: 0 }, 61 score: { millisElapsed: 0 } 62 } 63 }, 64 boost: 0.6666666269302368 65 }, 66 stats: { 67 context: { 68 millisElapsed: 0.248528, 69 invocationCounts: { 70 createWeight: Long('1'), 71 createScorer: Long('8') 72 } 73 }, 74 match: { 75 millisElapsed: 0.067561, 76 invocationCounts: { nextDoc: Long('3') } 77 }, 78 score: { 79 millisElapsed: 0.001649, 80 invocationCounts: { score: Long('2') } 81 } 82 } 83 }, 84 { 85 type: 'BoostQuery', 86 args: { 87 query: { 88 type: 'TermQuery', 89 args: { path: 'title', value: 'mark' }, 90 stats: { 91 context: { millisElapsed: 0 }, 92 match: { millisElapsed: 0 }, 93 score: { millisElapsed: 0 } 94 } 95 }, 96 boost: 0.75 97 }, 98 stats: { 99 context: { 100 millisElapsed: 0.337083, 101 invocationCounts: { 102 createWeight: Long('1'), 103 createScorer: Long('12') 104 } 105 }, 106 match: { 107 millisElapsed: 0.006489, 108 invocationCounts: { nextDoc: Long('11') } 109 }, 110 score: { 111 millisElapsed: 0.013741, 112 invocationCounts: { score: Long('8') } 113 } 114 } 115 }, 116 { 117 type: 'BoostQuery', 118 args: { 119 query: { 120 type: 'TermQuery', 121 args: { path: 'title', value: 'park' }, 122 stats: { 123 context: { millisElapsed: 0 }, 124 match: { millisElapsed: 0 }, 125 score: { millisElapsed: 0 } 126 } 127 }, 128 boost: 0.75 129 }, 130 stats: { 131 context: { 132 millisElapsed: 0.395528, 133 invocationCounts: { 134 createWeight: Long('1'), 135 createScorer: Long('16') 136 } 137 }, 138 match: { 139 millisElapsed: 0.091681, 140 invocationCounts: { nextDoc: Long('32') } 141 }, 142 score: { 143 millisElapsed: 0.137827, 144 invocationCounts: { score: Long('27') } 145 } 146 } 147 }, 148 { 149 type: 'BoostQuery', 150 args: { 151 query: { 152 type: 'TermQuery', 153 args: { path: 'title', value: 'york' }, 154 stats: { 155 context: { millisElapsed: 0 }, 156 match: { millisElapsed: 0 }, 157 score: { millisElapsed: 0 } 158 } 159 }, 160 boost: 0.75 161 }, 162 stats: { 163 context: { 164 millisElapsed: 0.150681, 165 invocationCounts: { 166 createWeight: Long('1'), 167 createScorer: Long('16') 168 } 169 }, 170 match: { 171 millisElapsed: 0.067298, 172 invocationCounts: { nextDoc: Long('33') } 173 }, 174 score: { 175 millisElapsed: 0.038636, 176 invocationCounts: { score: Long('28') } 177 } 178 } 179 }, 180 { 181 type: 'BoostQuery', 182 args: { 183 query: { 184 type: 'TermQuery', 185 args: { path: 'title', value: 'yard' }, 186 stats: { 187 context: { millisElapsed: 0 }, 188 match: { millisElapsed: 0 }, 189 score: { millisElapsed: 0 } 190 } 191 }, 192 boost: 0.75 193 }, 194 stats: { 195 context: { 196 millisElapsed: 0.104308, 197 invocationCounts: { 198 createWeight: Long('1'), 199 createScorer: Long('8') 200 } 201 }, 202 match: { 203 millisElapsed: 0.002445, 204 invocationCounts: { nextDoc: Long('4') } 205 }, 206 score: { 207 millisElapsed: 0.00233, 208 invocationCounts: { score: Long('3') } 209 } 210 } 211 } 212 ], 213 filter: [], 214 minimumShouldMatch: 0 215 }, 216 stats: { 217 context: { 218 millisElapsed: 12.8127, 219 invocationCounts: { createWeight: Long('1'), createScorer: Long('12') } 220 }, 221 match: { 222 millisElapsed: 0.761076, 223 invocationCounts: { nextDoc: Long('157') } 224 }, 225 score: { 226 millisElapsed: 0.857125, 227 invocationCounts: { score: Long('151') } 228 } 229 } 230 }, 231 collectors: { 232 allCollectorStats: { 233 millisElapsed: 2.061296, 234 invocationCounts: { 235 collect: Long('151'), 236 competitiveIterator: Long('6'), 237 setScorer: Long('6') 238 } 239 }, 240 facet: { collectorStats: { millisElapsed: 0 } } 241 }, 242 resultMaterialization: { 243 stats: { 244 millisElapsed: 17.759502, 245 invocationCounts: { retrieveAndSerialize: Long('1') } 246 } 247 }, 248 metadata: { 249 mongotVersion: '1.43.1', 250 mongotHostName: 'atlas-11decp-shard-00-02.2rnul.mongodb-dev.net', 251 indexName: 'default', 252 totalLuceneDocs: 21349 253 }, 254 resourceUsage: { 255 majorFaults: Long('0'), 256 minorFaults: Long('98'), 257 userTimeMs: Long('30'), 258 systemTimeMs: Long('0'), 259 maxReportingThreads: 1, 260 numBatches: 1 261 } 262 }, 263 requiresSearchMetaCursor: true 264 }, 265 nReturned: Long('0'), 266 executionTimeMillisEstimate: Long('108') 267 }, 268 { 269 '$_internalSearchIdLookup': {}, 270 nReturned: Long('0'), 271 executionTimeMillisEstimate: Long('108') 272 } 273 ], 274 queryShapeHash: '6FD3791F785FA329D4ECD1171E0E5AF6772C18F5F0A7A50FC416D080A93C8CB7', 275 serverInfo: { 276 host: 'atlas-11decp-shard-00-02.2rnul.mongodb-dev.net', 277 port: 27017, 278 version: '8.0.4', 279 gitVersion: 'bc35ab4305d9920d9d0491c1c9ef9b72383d31f9' 280 }, 281 serverParameters: { 282 ... 283 }, 284 command: { 285 aggregate: 'movies', 286 pipeline: [ 287 { 288 '$search': { 289 text: { 290 path: 'title', 291 query: 'yark', 292 fuzzy: { maxEdits: 1, maxExpansions: 100 } 293 } 294 } 295 } 296 ], 297 cursor: {}, 298 '$db': 'sample_mflix' 299 }, 300 ok: 1, 301 '$clusterTime': { 302 clusterTime: Timestamp({ t: 1738081279, i: 12 }), 303 signature: { 304 hash: Binary.createFromBase64('DM3imkEw1qT23M2n/b/JibqB1Fg=', 0), 305 keyId: Long('7462787091647168517') 306 } 307 }, 308 operationTime: Timestamp({ t: 1738081279, i: 12 }) 309 }
db.movies.explain("allPlansExecution").aggregate([ { $search: { "text": { "path": "title", "query": "prince" }, "highlight": { "path": "title", "maxNumPassages": 1, "maxCharsToExamine": 40 } } }, { $project: { "description": 1, "_id": 0, "highlights": { "$meta": "searchHighlights" } } } ])
1 { 2 explainVersion: '1', 3 stages: [ 4 { 5 '$_internalSearchMongotRemote': { 6 mongotQuery: { 7 text: { path: 'title', query: 'prince' }, 8 highlight: { path: 'title', maxNumPassages: 1, maxCharsToExamine: 40 } 9 }, 10 explain: { 11 query: { 12 type: 'TermQuery', 13 args: { path: 'title', value: 'prince' }, 14 stats: { 15 context: { 16 millisElapsed: 1.034149, 17 invocationCounts: { createWeight: Long('1'), createScorer: Long('10') } 18 }, 19 match: { 20 millisElapsed: 0.050591, 21 invocationCounts: { nextDoc: Long('29') } 22 }, 23 score: { 24 millisElapsed: 0.027259, 25 invocationCounts: { score: Long('25') } 26 } 27 } 28 }, 29 collectors: { 30 allCollectorStats: { 31 millisElapsed: 0.112751, 32 invocationCounts: { 33 collect: Long('25'), 34 competitiveIterator: Long('4'), 35 setScorer: Long('4') 36 } 37 }, 38 facet: { collectorStats: { millisElapsed: 0 } } 39 }, 40 highlight: { 41 resolvedHighlightPaths: [ '$type:string/title' ], 42 stats: { 43 millisElapsed: 10.665238, 44 invocationCounts: { 45 executeHighlight: Long('1'), 46 setupHighlight: Long('1') 47 } 48 } 49 }, 50 resultMaterialization: { 51 stats: { 52 millisElapsed: 3.548075, 53 invocationCounts: { retrieveAndSerialize: Long('1') } 54 } 55 }, 56 metadata: { 57 mongotVersion: '1.43.1', 58 mongotHostName: 'atlas-11decp-shard-00-02.2rnul.mongodb-dev.net', 59 indexName: 'default', 60 totalLuceneDocs: 21349 61 }, 62 resourceUsage: { 63 majorFaults: Long('0'), 64 minorFaults: Long('0'), 65 userTimeMs: Long('10'), 66 systemTimeMs: Long('0'), 67 maxReportingThreads: 1, 68 numBatches: 1 69 } 70 }, 71 requiresSearchMetaCursor: true 72 }, 73 nReturned: Long('0'), 74 executionTimeMillisEstimate: Long('31') 75 }, 76 { 77 '$_internalSearchIdLookup': {}, 78 nReturned: Long('0'), 79 executionTimeMillisEstimate: Long('31') 80 }, 81 { 82 '$project': { 83 description: true, 84 highlights: { '$meta': 'searchHighlights' }, 85 _id: false 86 }, 87 nReturned: Long('0'), 88 executionTimeMillisEstimate: Long('31') 89 } 90 ], 91 queryShapeHash: 'D08444272924C1E04A6E99D0CD4BF82FD929893862B3356F79EC18BBD1F0EF0C', 92 serverInfo: { 93 host: 'atlas-11decp-shard-00-02.2rnul.mongodb-dev.net', 94 port: 27017, 95 version: '8.0.4', 96 gitVersion: 'bc35ab4305d9920d9d0491c1c9ef9b72383d31f9' 97 }, 98 serverParameters: { 99 internalQueryFacetBufferSizeBytes: 104857600, 100 internalQueryFacetMaxOutputDocSizeBytes: 104857600, 101 internalLookupStageIntermediateDocumentMaxSizeBytes: 104857600, 102 internalDocumentSourceGroupMaxMemoryBytes: 104857600, 103 internalQueryMaxBlockingSortMemoryUsageBytes: 104857600, 104 internalQueryProhibitBlockingMergeOnMongoS: 0, 105 internalQueryMaxAddToSetBytes: 104857600, 106 internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600, 107 internalQueryFrameworkControl: 'trySbeRestricted', 108 internalQueryPlannerIgnoreIndexWithCollationForRegex: 1 109 }, 110 command: { 111 aggregate: 'movies', 112 pipeline: [ 113 { 114 '$search': { 115 text: { path: 'title', query: 'prince' }, 116 highlight: { path: 'title', maxNumPassages: 1, maxCharsToExamine: 40 } 117 } 118 }, 119 { 120 '$project': { 121 description: 1, 122 _id: 0, 123 highlights: { '$meta': 'searchHighlights' } 124 } 125 } 126 ], 127 cursor: {}, 128 '$db': 'sample_mflix' 129 }, 130 ok: 1, 131 '$clusterTime': { 132 clusterTime: Timestamp({ t: 1738081637, i: 1 }), 133 signature: { 134 hash: Binary.createFromBase64('TnFwebZsmrjLunk7/TN+9rfJ/8Y=', 0), 135 keyId: Long('7462787091647168517') 136 } 137 }, 138 operationTime: Timestamp({ t: 1738081637, i: 1 }) 139 }
db.movies.explain("allPlansExecution").aggregate([ { "$searchMeta": { "facet": { "operator": { "near": { "path": "released", "origin": ISODate("1921-11-01T00:00:00.000+00:00"), "pivot": 7776000000 } }, "facets": { "genresFacet": { "type": "string", "path": "genres" }, "yearFacet" : { "type" : "number", "path" : "year", "boundaries" : [1910,1920,1930,1940] } } } } } ])
1 { 2 explainVersion: '1', 3 stages: [ 4 { 5 '$searchMeta': { 6 mongotQuery: { 7 facet: { 8 operator: { 9 near: { 10 path: 'released', 11 origin: ISODate('1921-11-01T00:00:00.000Z'), 12 pivot: 7776000000 13 } 14 }, 15 facets: { 16 genresFacet: { type: 'string', path: 'genres' }, 17 yearFacet: { 18 type: 'number', 19 path: 'year', 20 boundaries: [ 1910, 1920, 1930, 1940 ] 21 } 22 } 23 } 24 }, 25 explain: { 26 query: { 27 type: 'LongDistanceFeatureQuery', 28 args: {}, 29 stats: { 30 context: { 31 millisElapsed: 0.684076, 32 invocationCounts: { createWeight: Long('1'), createScorer: Long('12') } 33 }, 34 match: { 35 millisElapsed: 1.285512, 36 invocationCounts: { nextDoc: Long('20884') } 37 }, 38 score: { 39 millisElapsed: 1.321738, 40 invocationCounts: { score: Long('20878') } 41 } 42 } 43 }, 44 collectors: { 45 allCollectorStats: { 46 millisElapsed: 10.536043, 47 invocationCounts: { 48 collect: Long('20878'), 49 competitiveIterator: Long('6'), 50 setScorer: Long('6') 51 } 52 }, 53 facet: { 54 collectorStats: { 55 millisElapsed: 3.730834, 56 invocationCounts: { collect: Long('20878'), setScorer: Long('6') } 57 }, 58 createCountsStats: { 59 millisElapsed: 10.350302, 60 invocationCounts: { generateFacetCounts: Long('2') } 61 }, 62 stringFacetCardinalities: { genresFacet: { queried: 10, total: 25 } } 63 } 64 }, 65 resultMaterialization: { 66 stats: { 67 millisElapsed: 10.645713, 68 invocationCounts: { retrieveAndSerialize: Long('1') } 69 } 70 }, 71 metadata: { 72 mongotVersion: '1.43.1', 73 mongotHostName: 'atlas-11decp-shard-00-02.2rnul.mongodb-dev.net', 74 indexName: 'default', 75 totalLuceneDocs: 21349 76 }, 77 resourceUsage: { 78 majorFaults: Long('0'), 79 minorFaults: Long('0'), 80 userTimeMs: Long('10'), 81 systemTimeMs: Long('0'), 82 maxReportingThreads: 1, 83 numBatches: 1 84 } 85 }, 86 requiresSearchMetaCursor: true 87 }, 88 nReturned: Long('0'), 89 executionTimeMillisEstimate: Long('57') 90 } 91 ], 92 queryShapeHash: '582DB864C9BCFB96896CF1A3079CF70FAC10A9A1E19E8D66DF20A2BB40424FB5', 93 serverInfo: { 94 host: 'atlas-11decp-shard-00-02.2rnul.mongodb-dev.net', 95 port: 27017, 96 version: '8.0.4', 97 gitVersion: 'bc35ab4305d9920d9d0491c1c9ef9b72383d31f9' 98 }, 99 serverParameters: { 100 internalQueryFacetBufferSizeBytes: 104857600, 101 internalQueryFacetMaxOutputDocSizeBytes: 104857600, 102 internalLookupStageIntermediateDocumentMaxSizeBytes: 104857600, 103 internalDocumentSourceGroupMaxMemoryBytes: 104857600, 104 internalQueryMaxBlockingSortMemoryUsageBytes: 104857600, 105 internalQueryProhibitBlockingMergeOnMongoS: 0, 106 internalQueryMaxAddToSetBytes: 104857600, 107 internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600, 108 internalQueryFrameworkControl: 'trySbeRestricted', 109 internalQueryPlannerIgnoreIndexWithCollationForRegex: 1 110 }, 111 command: { 112 aggregate: 'movies', 113 pipeline: [ 114 { 115 '$searchMeta': { 116 facet: { 117 operator: { 118 near: { 119 path: 'released', 120 origin: ISODate('1921-11-01T00:00:00.000Z'), 121 pivot: 7776000000 122 } 123 }, 124 facets: { 125 genresFacet: { type: 'string', path: 'genres' }, 126 yearFacet: { 127 type: 'number', 128 path: 'year', 129 boundaries: [ 1910, 1920, 1930, 1940 ] 130 } 131 } 132 } 133 } 134 } 135 ], 136 cursor: {}, 137 '$db': 'sample_mflix' 138 }, 139 ok: 1, 140 '$clusterTime': { 141 clusterTime: Timestamp({ t: 1738081767, i: 1 }), 142 signature: { 143 hash: Binary.createFromBase64('ieRjqe84DdOnmlCcP3XBelo8vyM=', 0), 144 keyId: Long('7462787091647168517') 145 } 146 }, 147 operationTime: Timestamp({ t: 1738081767, i: 1 }) 148 }
queryPlanner
次の例では、さまざまな演算子を使用して、title
queryPlanner
冗長モードで フィールドをクエリします。
db.movies.explain("queryPlanner").aggregate([ { $search: { "text": { "path": "title", "query": "yark", "fuzzy": { "maxEdits": 1, "maxExpansions": 100, } } } } ])
1 { 2 "stages" : [ 3 { 4 "$_internalSearchMongotRemote" : { 5 "mongotQuery" : { 6 "text" : { 7 "path" : "title", 8 "query" : "yark", 9 "fuzzy" : { 10 "maxEdits" : 1, 11 "maxExpansions" : 100 12 } 13 } 14 }, 15 "explain" : { 16 "type" : "BooleanQuery", 17 "args" : { 18 "must" : [ ], 19 "mustNot" : [ ], 20 "should" : [ 21 { 22 "type" : "BoostQuery", 23 "args" : { 24 "query" : { 25 "type" : "TermQuery", 26 "args" : { 27 "path" : "title", 28 "value" : "ark" 29 } 30 }, 31 "boost" : 0.6666666269302368 32 } 33 }, 34 { 35 "type" : "BoostQuery", 36 "args" : { 37 "query" : { 38 "type" : "TermQuery", 39 "args" : { 40 "path" : "title", 41 "value" : "yard" 42 } 43 }, 44 "boost" : 0.75 45 } 46 }, 47 { 48 "type" : "BoostQuery", 49 "args" : { 50 "query" : { 51 "type" : "TermQuery", 52 "args" : { 53 "path" : "title", 54 "value" : "mark" 55 } 56 }, 57 "boost" : 0.75 58 } 59 }, 60 { 61 "type" : "BoostQuery", 62 "args" : { 63 "query" : { 64 "type" : "TermQuery", 65 "args" : { 66 "path" : "title", 67 "value" : "park" 68 } 69 }, 70 "boost" : 0.75 71 } 72 }, 73 { 74 "type" : "BoostQuery", 75 "args" : { 76 "query" : { 77 "type" : "TermQuery", 78 "args" : { 79 "path" : "title", 80 "value" : "dark" 81 } 82 }, 83 "boost" : 0.75 84 } 85 }, 86 { 87 "type" : "BoostQuery", 88 "args" : { 89 "query" : { 90 "type" : "TermQuery", 91 "args" : { 92 "path" : "title", 93 "value" : "york" 94 } 95 }, 96 "boost" : 0.75 97 } 98 } 99 ], 100 "filter" : [ ], 101 "minimumShouldMatch" : 0 102 } 103 } 104 } 105 }, 106 { 107 "$_internalSearchIdLookup" : { } 108 } 109 ], 110 "serverInfo" : { 111 "host" : "atlas-example-shard-00-01.mongodb.net", 112 "port" : 27017, 113 "version" : "4.4.3", 114 "gitVersion" : "913d6b62acfbb344dde1b116f4161360acd8fd13" 115 }, 116 "ok" : 1, 117 "$clusterTime" : { 118 "clusterTime" : Timestamp(1612457287, 1), 119 "signature" : { 120 "hash" : BinData(0,"kzn7hY7NOduVIqcfx+40ENKbMKQ="), 121 "keyId" : NumberLong("1234567890123456789") 122 } 123 }, 124 "operationTime" : Timestamp(1612457287, 1) 125 }
db.movies.explain("queryPlanner").aggregate([ { $search: { "text": { "path": "title", "query": "prince" }, "highlight": { "path": "title", "maxNumPassages": 1, "maxCharsToExamine": 40 } } }, { $project: { "description": 1, "_id": 0, "highlights": { "$meta": "searchHighlights" } } } ])
1 { 2 explainVersion: '1', 3 stages: [ 4 { 5 '$_internalSearchMongotRemote': { 6 mongotQuery: { 7 text: { path: 'title', query: 'prince' }, 8 highlight: { path: 'title', maxNumPassages: 1, maxCharsToExamine: 40 } 9 }, 10 explain: { 11 query: { 12 type: 'TermQuery', 13 args: { path: 'title', value: 'prince' } 14 }, 15 highlight: { resolvedHighlightPaths: [ '$type:string/title' ] }, 16 metadata: { 17 mongotVersion: '1.43.1', 18 mongotHostName: 'atlas-11decp-shard-00-02.2rnul.mongodb-dev.net', 19 indexName: 'default', 20 totalLuceneDocs: 21349 21 } 22 }, 23 requiresSearchMetaCursor: true 24 } 25 }, 26 { '$_internalSearchIdLookup': {} }, 27 { 28 '$project': { 29 description: true, 30 highlights: { '$meta': 'searchHighlights' }, 31 _id: false 32 } 33 } 34 ], 35 queryShapeHash: 'D08444272924C1E04A6E99D0CD4BF82FD929893862B3356F79EC18BBD1F0EF0C', 36 serverInfo: { 37 host: 'atlas-11decp-shard-00-02.2rnul.mongodb-dev.net', 38 port: 27017, 39 version: '8.0.4', 40 gitVersion: 'bc35ab4305d9920d9d0491c1c9ef9b72383d31f9' 41 }, 42 serverParameters: { 43 internalQueryFacetBufferSizeBytes: 104857600, 44 internalQueryFacetMaxOutputDocSizeBytes: 104857600, 45 internalLookupStageIntermediateDocumentMaxSizeBytes: 104857600, 46 internalDocumentSourceGroupMaxMemoryBytes: 104857600, 47 internalQueryMaxBlockingSortMemoryUsageBytes: 104857600, 48 internalQueryProhibitBlockingMergeOnMongoS: 0, 49 internalQueryMaxAddToSetBytes: 104857600, 50 internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600, 51 internalQueryFrameworkControl: 'trySbeRestricted', 52 internalQueryPlannerIgnoreIndexWithCollationForRegex: 1 53 }, 54 command: { 55 aggregate: 'movies', 56 pipeline: [ 57 { 58 '$search': { 59 text: { path: 'title', query: 'prince' }, 60 highlight: { path: 'title', maxNumPassages: 1, maxCharsToExamine: 40 } 61 } 62 }, 63 { 64 '$project': { 65 description: 1, 66 _id: 0, 67 highlights: { '$meta': 'searchHighlights' } 68 } 69 } 70 ], 71 cursor: {}, 72 '$db': 'sample_mflix' 73 }, 74 ok: 1, 75 '$clusterTime': { 76 clusterTime: Timestamp({ t: 1738080637, i: 1 }), 77 signature: { 78 hash: Binary.createFromBase64('fIedxkRaoE5IWmIaN7/BsRC0AJc=', 0), 79 keyId: Long('7462787091647168517') 80 } 81 }, 82 operationTime: Timestamp({ t: 1738080637, i: 1 }) 83 }
db.movies.explain("queryPlanner").aggregate([ { "$searchMeta": { "facet": { "operator": { "near": { "path": "released", "origin": ISODate("1921-11-01T00:00:00.000+00:00"), "pivot": 7776000000 } }, "facets": { "genresFacet": { "type": "string", "path": "genres" }, "yearFacet" : { "type" : "number", "path" : "year", "boundaries" : [1910,1920,1930,1940] } } } } } ])
1 { 2 explainVersion: '1', 3 stages: [ 4 { 5 '$searchMeta': { 6 mongotQuery: { 7 facet: { 8 operator: { 9 near: { 10 path: 'released', 11 origin: ISODate('1921-11-01T00:00:00.000Z'), 12 pivot: 7776000000 13 } 14 }, 15 facets: { 16 genresFacet: { type: 'string', path: 'genres' }, 17 yearFacet: { 18 type: 'number', 19 path: 'year', 20 boundaries: [ 1910, 1920, 1930, 1940 ] 21 } 22 } 23 } 24 }, 25 explain: { 26 query: { type: 'LongDistanceFeatureQuery', args: {} }, 27 collectors: { 28 facet: { 29 stringFacetCardinalities: { genresFacet: { queried: 10, total: 25 } } 30 } 31 }, 32 metadata: { 33 mongotVersion: '1.43.1', 34 mongotHostName: 'atlas-11decp-shard-00-02.2rnul.mongodb-dev.net', 35 indexName: 'default', 36 totalLuceneDocs: 21349 37 } 38 }, 39 requiresSearchMetaCursor: true 40 } 41 } 42 ], 43 queryShapeHash: '582DB864C9BCFB96896CF1A3079CF70FAC10A9A1E19E8D66DF20A2BB40424FB5', 44 serverInfo: { 45 host: 'atlas-11decp-shard-00-02.2rnul.mongodb-dev.net', 46 port: 27017, 47 version: '8.0.4', 48 gitVersion: 'bc35ab4305d9920d9d0491c1c9ef9b72383d31f9' 49 }, 50 serverParameters: { 51 internalQueryFacetBufferSizeBytes: 104857600, 52 internalQueryFacetMaxOutputDocSizeBytes: 104857600, 53 internalLookupStageIntermediateDocumentMaxSizeBytes: 104857600, 54 internalDocumentSourceGroupMaxMemoryBytes: 104857600, 55 internalQueryMaxBlockingSortMemoryUsageBytes: 104857600, 56 internalQueryProhibitBlockingMergeOnMongoS: 0, 57 internalQueryMaxAddToSetBytes: 104857600, 58 internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600, 59 internalQueryFrameworkControl: 'trySbeRestricted', 60 internalQueryPlannerIgnoreIndexWithCollationForRegex: 1 61 }, 62 command: { 63 aggregate: 'movies', 64 pipeline: [ 65 { 66 '$searchMeta': { 67 facet: { 68 operator: { 69 near: { 70 path: 'released', 71 origin: ISODate('1921-11-01T00:00:00.000Z'), 72 pivot: 7776000000 73 } 74 }, 75 facets: { 76 genresFacet: { type: 'string', path: 'genres' }, 77 yearFacet: { 78 type: 'number', 79 path: 'year', 80 boundaries: [ 1910, 1920, 1930, 1940 ] 81 } 82 } 83 } 84 } 85 } 86 ], 87 cursor: {}, 88 '$db': 'sample_mflix' 89 }, 90 ok: 1, 91 '$clusterTime': { 92 clusterTime: Timestamp({ t: 1738080797, i: 1 }), 93 signature: { 94 hash: Binary.createFromBase64('2E8qAEihttRWdJRyCTXRfA1es7I=', 0), 95 keyId: Long('7462787091647168517') 96 } 97 }, 98 operationTime: Timestamp({ t: 1738080797, i: 1 }) 99 }
パイプラインで$limit
ステージを指定するクエリの場合、 explain
の結果にはmongotDocsRequested
メトリクスが含まれます。これは、 mongod
がmongot
からリクエストしたドキュメントの数を示します。
例
{ "mongotQuery": {}, "explain": {}, "limit": <int>, "sortSpec": {}, "mongotDocsRequested": <int>, }
executionStats
次の例では、オートコンプリート演算子を使用して、 executionStats
の冗長モードでtitle
フィールドをクエリします。
1 db.movies.explain("executionStats").aggregate([ 2 { 3 "$search": { 4 "autocomplete": { 5 "path": "title", 6 "query": "pre", 7 "fuzzy": { 8 "maxEdits": 1, 9 "prefixLength": 1, 10 "maxExpansions": 256 11 } 12 } 13 } 14 } 15 ])
1 { 2 explainVersion: '1', 3 stages: [ 4 { 5 '$_internalSearchMongotRemote': { 6 mongotQuery: { 7 autocomplete: { 8 path: 'title', 9 query: 'pre', 10 fuzzy: { maxEdits: 1, prefixLength: 1, maxExpansions: 256 } 11 } 12 }, 13 explain: { 14 query: { 15 type: 'BooleanQuery', 16 args: { 17 must: [ 18 { 19 type: 'MultiTermQueryConstantScoreBlendedWrapper', 20 args: { 21 queries: [ 22 { 23 type: 'DefaultQuery', 24 args: { queryType: 'AutomatonQuery' }, 25 stats: { 26 context: { millisElapsed: 0 }, 27 match: { millisElapsed: 0 }, 28 score: { millisElapsed: 0 } 29 } 30 } 31 ] 32 }, 33 stats: { 34 context: { 35 millisElapsed: 34.187255, 36 invocationCounts: { 37 createWeight: Long('1'), 38 createScorer: Long('15') 39 } 40 }, 41 match: { 42 millisElapsed: 1.077211, 43 invocationCounts: { nextDoc: Long('812') } 44 }, 45 score: { 46 millisElapsed: 0.274761, 47 invocationCounts: { score: Long('807') } 48 } 49 } 50 } 51 ], 52 mustNot: [], 53 should: [ 54 { 55 type: 'TermQuery', 56 args: { path: 'title', value: 'pre' }, 57 stats: { 58 context: { 59 millisElapsed: 2.495506, 60 invocationCounts: { 61 createWeight: Long('1'), 62 createScorer: Long('5') 63 } 64 }, 65 match: { millisElapsed: 0 }, 66 score: { millisElapsed: 0 } 67 } 68 } 69 ], 70 filter: [], 71 minimumShouldMatch: 0 72 }, 73 stats: { 74 context: { 75 millisElapsed: 43.795864, 76 invocationCounts: { createWeight: Long('1'), createScorer: Long('10') } 77 }, 78 match: { 79 millisElapsed: 1.911068, 80 invocationCounts: { nextDoc: Long('812') } 81 }, 82 score: { 83 millisElapsed: 0.982801, 84 invocationCounts: { score: Long('807') } 85 } 86 } 87 }, 88 collectors: { 89 allCollectorStats: { 90 millisElapsed: 2.51114, 91 invocationCounts: { 92 collect: Long('807'), 93 competitiveIterator: Long('5'), 94 setScorer: Long('5') 95 } 96 }, 97 facet: { collectorStats: { millisElapsed: 0 } } 98 }, 99 resultMaterialization: { 100 stats: { 101 millisElapsed: 10.23124, 102 invocationCounts: { retrieveAndSerialize: Long('1') } 103 } 104 }, 105 metadata: { 106 mongotVersion: '1.43.0', 107 mongotHostName: 'atlas-11decp-shard-00-01.2rnul.mongodb-dev.net', 108 indexName: 'default', 109 totalLuceneDocs: 21349 110 }, 111 resourceUsage: { 112 majorFaults: Long('0'), 113 minorFaults: Long('145'), 114 userTimeMs: Long('30'), 115 systemTimeMs: Long('10'), 116 maxReportingThreads: 1, 117 numBatches: 1 118 } 119 }, 120 requiresSearchMetaCursor: true 121 }, 122 nReturned: Long('0'), 123 executionTimeMillisEstimate: Long('311') 124 }, 125 { 126 '$_internalSearchIdLookup': {}, 127 nReturned: Long('0'), 128 executionTimeMillisEstimate: Long('311') 129 } 130 ], 131 queryShapeHash: '6FD3791F785FA329D4ECD1171E0E5AF6772C18F5F0A7A50FC416D080A93C8CB7', 132 serverInfo: { 133 host: 'atlas-11decp-shard-00-01.2rnul.mongodb-dev.net', 134 port: 27017, 135 version: '8.0.4', 136 gitVersion: 'bc35ab4305d9920d9d0491c1c9ef9b72383d31f9' 137 }, 138 serverParameters: { 139 internalQueryFacetBufferSizeBytes: 104857600, 140 internalQueryFacetMaxOutputDocSizeBytes: 104857600, 141 internalLookupStageIntermediateDocumentMaxSizeBytes: 104857600, 142 internalDocumentSourceGroupMaxMemoryBytes: 104857600, 143 internalQueryMaxBlockingSortMemoryUsageBytes: 104857600, 144 internalQueryProhibitBlockingMergeOnMongoS: 0, 145 internalQueryMaxAddToSetBytes: 104857600, 146 internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600, 147 internalQueryFrameworkControl: 'trySbeRestricted', 148 internalQueryPlannerIgnoreIndexWithCollationForRegex: 1 149 }, 150 command: { 151 aggregate: 'movies', 152 pipeline: [ 153 { 154 '$search': { 155 autocomplete: { 156 path: 'title', 157 query: 'pre', 158 fuzzy: { maxEdits: 1, prefixLength: 1, maxExpansions: 256 } 159 } 160 } 161 } 162 ], 163 cursor: {}, 164 '$db': 'sample_mflix' 165 }, 166 ok: 1, 167 '$clusterTime': { 168 clusterTime: Timestamp({ t: 1737671412, i: 10 }), 169 signature: { 170 hash: Binary.createFromBase64('a3CSqvS0rziAYQCk33WzTo/0Sow=', 0), 171 keyId: Long('7462787091647168517') 172 } 173 }, 174 operationTime: Timestamp({ t: 1737671412, i: 10 }) 175 }
応答要素の詳細については explain の結果explain
を参照してください。