|
@@ -71,7 +71,11 @@ The API returns the following result:
|
|
|
"profile": {
|
|
|
"shards": [
|
|
|
{
|
|
|
- "id": "[2aE02wS1R8q_QFnYu6vDVQ][my-index-000001][0]",
|
|
|
+ "id": "[q2aE02wS1R8qQFnYu6vDVQ][my-index-000001][0]",
|
|
|
+ "node_id": "q2aE02wS1R8qQFnYu6vDVQ",
|
|
|
+ "shard_id": 0,
|
|
|
+ "index": "my-index-000001",
|
|
|
+ "cluster": "(local)",
|
|
|
"searches": [
|
|
|
{
|
|
|
"query": [
|
|
@@ -221,7 +225,8 @@ The API returns the following result:
|
|
|
// TESTRESPONSE[s/"took": 25/"took": $body.took/]
|
|
|
// TESTRESPONSE[s/"hits": \[...\]/"hits": $body.$_path/]
|
|
|
// TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$_path/]
|
|
|
-// TESTRESPONSE[s/\[2aE02wS1R8q_QFnYu6vDVQ\]\[my-index-000001\]\[0\]/$body.$_path/]
|
|
|
+// TESTRESPONSE[s/"id": "\[q2aE02wS1R8qQFnYu6vDVQ\]\[my-index-000001\]\[0\]"/"id": $body.profile.shards.0.id/]
|
|
|
+// TESTRESPONSE[s/"node_id": "q2aE02wS1R8qQFnYu6vDVQ",/"node_id": "$body.profile.shards.0.node_id",/]
|
|
|
|
|
|
<1> Search results are returned, but were omitted here for brevity.
|
|
|
|
|
@@ -237,16 +242,20 @@ The overall structure of the profile response is as follows:
|
|
|
"profile": {
|
|
|
"shards": [
|
|
|
{
|
|
|
- "id": "[2aE02wS1R8q_QFnYu6vDVQ][my-index-000001][0]", <1>
|
|
|
+ "id": "[q2aE02wS1R8qQFnYu6vDVQ][my-index-000001][0]", <1>
|
|
|
+ "node_id": "q2aE02wS1R8qQFnYu6vDVQ",
|
|
|
+ "shard_id": 0,
|
|
|
+ "index": "my-index-000001",
|
|
|
+ "cluster": "(local)", <2>
|
|
|
"searches": [
|
|
|
{
|
|
|
- "query": [...], <2>
|
|
|
- "rewrite_time": 51443, <3>
|
|
|
- "collector": [...] <4>
|
|
|
+ "query": [...], <3>
|
|
|
+ "rewrite_time": 51443, <4>
|
|
|
+ "collector": [...] <5>
|
|
|
}
|
|
|
],
|
|
|
- "aggregations": [...], <5>
|
|
|
- "fetch": {...} <6>
|
|
|
+ "aggregations": [...], <6>
|
|
|
+ "fetch": {...} <7>
|
|
|
}
|
|
|
]
|
|
|
}
|
|
@@ -254,23 +263,31 @@ The overall structure of the profile response is as follows:
|
|
|
--------------------------------------------------
|
|
|
// TESTRESPONSE[s/"profile": /"took": $body.took, "timed_out": $body.timed_out, "_shards": $body._shards, "hits": $body.hits, "profile": /]
|
|
|
// TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$_path/]
|
|
|
-// TESTRESPONSE[s/\[2aE02wS1R8q_QFnYu6vDVQ\]\[my-index-000001\]\[0\]/$body.$_path/]
|
|
|
+// TESTRESPONSE[s/"id": "\[q2aE02wS1R8qQFnYu6vDVQ\]\[my-index-000001\]\[0\]"/"id": $body.profile.shards.0.id/]
|
|
|
+// TESTRESPONSE[s/"node_id": "q2aE02wS1R8qQFnYu6vDVQ",/"node_id": "$body.profile.shards.0.node_id",/]
|
|
|
// TESTRESPONSE[s/"query": \[...\]/"query": $body.$_path/]
|
|
|
// TESTRESPONSE[s/"collector": \[...\]/"collector": $body.$_path/]
|
|
|
// TESTRESPONSE[s/"aggregations": \[...\]/"aggregations": []/]
|
|
|
// TESTRESPONSE[s/"fetch": \{...\}/"fetch": $body.$_path/]
|
|
|
<1> A profile is returned for each shard that participated in the response, and
|
|
|
is identified by a unique ID.
|
|
|
-<2> Query timings and other debugging information.
|
|
|
-<3> The cumulative rewrite time.
|
|
|
-<4> Names and invocation timings for each collector.
|
|
|
-<5> Aggregation timings, invocation counts, and debug information.
|
|
|
-<6> Fetch timing and debug information.
|
|
|
+<2> If the query was run on the local cluster, the cluster name is left out of the
|
|
|
+composite id and is marked "(local)" here. For a profile running on a remote_cluster
|
|
|
+using cross-cluster search, the "id" value would be something like
|
|
|
+`[q2aE02wS1R8qQFnYu6vDVQ][remote1:my-index-000001][0]` and the "cluster"
|
|
|
+value would be `remote1`.
|
|
|
+<3> Query timings and other debugging information.
|
|
|
+<4> The cumulative rewrite time.
|
|
|
+<5> Names and invocation timings for each collector.
|
|
|
+<6> Aggregation timings, invocation counts, and debug information.
|
|
|
+<7> Fetch timing and debug information.
|
|
|
|
|
|
Because a search request may be executed against one or more shards in an index,
|
|
|
and a search may cover one or more indices, the top level element in the profile
|
|
|
response is an array of `shard` objects. Each shard object lists its `id` which
|
|
|
uniquely identifies the shard. The ID's format is
|
|
|
+`[nodeID][clusterName:indexName][shardID]`. If the search is run against the
|
|
|
+local cluster then the clusterName is not added and the format is
|
|
|
`[nodeID][indexName][shardID]`.
|
|
|
|
|
|
The profile itself may consist of one or more "searches", where a search is a
|
|
@@ -343,7 +360,7 @@ Using our previous `match` query example, let's analyze the `query` section:
|
|
|
}
|
|
|
]
|
|
|
--------------------------------------------------
|
|
|
-// TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed_out": $body.timed_out,\n"_shards": $body._shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ {\n"id": "$body.$_path",\n"searches": [{\n/]
|
|
|
+// TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed_out": $body.timed_out,\n"_shards": $body._shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ {\n"id": "$body.profile.shards.0.id",\n"node_id": "$body.profile.shards.0.node_id",\n"shard_id": $body.profile.shards.0.shard_id,\n"index": "$body.profile.shards.0.index",\n"cluster": "(local)",\n"searches": [{\n/]
|
|
|
// TESTRESPONSE[s/]$/],"rewrite_time": $body.$_path, "collector": $body.$_path}], "aggregations": [], "fetch": $body.$_path}]}}/]
|
|
|
// TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$_path/]
|
|
|
// TESTRESPONSE[s/"breakdown": \{...\}/"breakdown": $body.$_path/]
|
|
@@ -397,7 +414,7 @@ Lucene execution:
|
|
|
"count_weight_count": 0
|
|
|
}
|
|
|
--------------------------------------------------
|
|
|
-// TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed_out": $body.timed_out,\n"_shards": $body._shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ {\n"id": "$body.$_path",\n"searches": [{\n"query": [{\n"type": "BooleanQuery",\n"description": "message:get message:search",\n"time_in_nanos": $body.$_path,/]
|
|
|
+// TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed_out": $body.timed_out,\n"_shards": $body._shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ {\n"id": "$body.profile.shards.0.id",\n"node_id": "$body.profile.shards.0.node_id",\n"shard_id": $body.profile.shards.0.shard_id,\n"index": "$body.profile.shards.0.index",\n"cluster": "(local)",\n"searches": [{\n"query": [{\n"type": "BooleanQuery",\n"description": "message:get message:search",\n"time_in_nanos": $body.$_path,/]
|
|
|
// TESTRESPONSE[s/}$/},\n"children": $body.$_path}],\n"rewrite_time": $body.$_path, "collector": $body.$_path}], "aggregations": [], "fetch": $body.$_path}]}}/]
|
|
|
// TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$_path/]
|
|
|
|
|
@@ -498,7 +515,7 @@ Looking at the previous example:
|
|
|
}
|
|
|
]
|
|
|
--------------------------------------------------
|
|
|
-// TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed_out": $body.timed_out,\n"_shards": $body._shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ {\n"id": "$body.$_path",\n"searches": [{\n"query": $body.$_path,\n"rewrite_time": $body.$_path,/]
|
|
|
+// TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed_out": $body.timed_out,\n"_shards": $body._shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ {\n"id": "$body.profile.shards.0.id",\n"node_id": "$body.profile.shards.0.node_id",\n"shard_id": $body.profile.shards.0.shard_id,\n"index": "$body.profile.shards.0.index",\n"cluster": "(local)",\n"searches": [{\n"query": $body.$_path,\n"rewrite_time": $body.$_path,/]
|
|
|
// TESTRESPONSE[s/]$/]}], "aggregations": [], "fetch": $body.$_path}]}}/]
|
|
|
// TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$_path/]
|
|
|
|
|
@@ -620,7 +637,7 @@ GET /my-index-000001/_search
|
|
|
}
|
|
|
--------------------------------------------------
|
|
|
// TEST[setup:my_index]
|
|
|
-// TEST[s/_search/_search\?filter_path=profile.shards.id,profile.shards.searches,profile.shards.aggregations,profile.shards.fetch/]
|
|
|
+// TEST[s/_search/_search\?filter_path=profile.shards.id,profile.shards.node_id,profile.shards.shard_id,profile.shards.index,profile.shards.cluster,profile.shards.searches,profile.shards.aggregations,profile.shards.fetch/]
|
|
|
|
|
|
|
|
|
This example has:
|
|
@@ -640,7 +657,11 @@ The API returns the following result:
|
|
|
"profile": {
|
|
|
"shards": [
|
|
|
{
|
|
|
- "id": "[P6-vulHtQRWuD4YnubWb7A][my-index-000001][0]",
|
|
|
+ "id": "[P6xvulHtQRWuD4YnubWb7A][my-index-000001][0]",
|
|
|
+ "node_id": "P6xvulHtQRWuD4YnubWb7A",
|
|
|
+ "shard_id": 0,
|
|
|
+ "index": "my-index-000001",
|
|
|
+ "cluster": "(local)",
|
|
|
"searches": [
|
|
|
{
|
|
|
"query": [
|
|
@@ -739,7 +760,8 @@ The API returns the following result:
|
|
|
// TESTRESPONSE[s/"fetch": \{\.\.\.\}/"fetch": $body.$_path/]
|
|
|
// TESTRESPONSE[s/\.\.\.//]
|
|
|
// TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$_path/]
|
|
|
-// TESTRESPONSE[s/"id": "\[P6-vulHtQRWuD4YnubWb7A\]\[my-index-000001\]\[0\]"/"id": $body.profile.shards.0.id/]
|
|
|
+// TESTRESPONSE[s/"id": "\[P6xvulHtQRWuD4YnubWb7A\]\[my-index-000001\]\[0\]"/"id": $body.profile.shards.0.id/]
|
|
|
+// TESTRESPONSE[s/"node_id": "P6xvulHtQRWuD4YnubWb7A",/"node_id": "$body.profile.shards.0.node_id",/]
|
|
|
<1> The `"aggregations"` portion has been omitted because it will be covered in
|
|
|
the next section.
|
|
|
|
|
@@ -1176,7 +1198,7 @@ One of the `dfs` sections for a shard looks like the following:
|
|
|
}
|
|
|
}
|
|
|
--------------------------------------------------
|
|
|
-// TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed_out": $body.timed_out,\n"_shards": $body._shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ "$body.$_path", {\n"id": "$body.$_path",\n/]
|
|
|
+// TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed_out": $body.timed_out,\n"_shards": $body._shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ "$body.$_path", {\n"id": "$body.$_path",\n"node_id": "$body.$_path",\n"shard_id": "$body.$_path",\n"index": "$body.$_path",\n"cluster": "$body.$_path",\n/]
|
|
|
// TESTRESPONSE[s/}$/}, "aggregations": [], "searches": $body.$_path}]}}/]
|
|
|
// TESTRESPONSE[s/(\-)?[0-9]+/ $body.$_path/]
|
|
|
|
|
@@ -1290,7 +1312,7 @@ One of the `dfs.knn` sections for a shard looks like the following:
|
|
|
} ]
|
|
|
}
|
|
|
--------------------------------------------------
|
|
|
-// TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed_out": $body.timed_out,\n"_shards": $body._shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ {\n"id": "$body.$_path",\n/]
|
|
|
+// TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed_out": $body.timed_out,\n"_shards": $body._shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ {\n"id": "$body.$_path",\n"node_id": "$body.$_path",\n"shard_id": "$body.$_path",\n"index": "$body.$_path",\n"cluster": "$body.$_path",\n/]
|
|
|
// TESTRESPONSE[s/}$/}, "aggregations": [], "searches": $body.$_path, "fetch": $body.$_path}]}}/]
|
|
|
// TESTRESPONSE[s/ (\-)?[0-9]+/ $body.$_path/]
|
|
|
// TESTRESPONSE[s/"dfs" : \{/"dfs" : {"statistics": $body.$_path,/]
|