|
@@ -14,29 +14,27 @@ Full example:
|
|
|
|
|
|
[source,js]
|
|
|
--------------------------------------------------
|
|
|
-curl -XGET 'localhost:9200/twitter/_search_shards'
|
|
|
+GET /twitter/_search_shards
|
|
|
--------------------------------------------------
|
|
|
+// CONSOLE
|
|
|
+// TEST[s/^/PUT twitter\n/]
|
|
|
|
|
|
This will yield the following result:
|
|
|
|
|
|
[source,js]
|
|
|
--------------------------------------------------
|
|
|
{
|
|
|
- "nodes": {
|
|
|
- "JklnKbD7Tyqi9TP3_Q_tBg": {
|
|
|
- "name": "Rl'nnd",
|
|
|
- "transport_address": "inet[/192.168.1.113:9300]"
|
|
|
- }
|
|
|
- },
|
|
|
+ "nodes": ...,
|
|
|
"shards": [
|
|
|
[
|
|
|
{
|
|
|
"index": "twitter",
|
|
|
"node": "JklnKbD7Tyqi9TP3_Q_tBg",
|
|
|
"primary": true,
|
|
|
- "relocating_node": null,
|
|
|
- "shard": 3,
|
|
|
- "state": "STARTED"
|
|
|
+ "shard": 0,
|
|
|
+ "state": "STARTED",
|
|
|
+ "allocation_id": {"id":"0TvkCyF7TAmM1wHP4a42-A"},
|
|
|
+ "relocating_node": null
|
|
|
}
|
|
|
],
|
|
|
[
|
|
@@ -44,9 +42,10 @@ This will yield the following result:
|
|
|
"index": "twitter",
|
|
|
"node": "JklnKbD7Tyqi9TP3_Q_tBg",
|
|
|
"primary": true,
|
|
|
- "relocating_node": null,
|
|
|
- "shard": 4,
|
|
|
- "state": "STARTED"
|
|
|
+ "shard": 1,
|
|
|
+ "state": "STARTED",
|
|
|
+ "allocation_id": {"id":"fMju3hd1QHWmWrIgFnI4Ww"},
|
|
|
+ "relocating_node": null
|
|
|
}
|
|
|
],
|
|
|
[
|
|
@@ -54,9 +53,10 @@ This will yield the following result:
|
|
|
"index": "twitter",
|
|
|
"node": "JklnKbD7Tyqi9TP3_Q_tBg",
|
|
|
"primary": true,
|
|
|
- "relocating_node": null,
|
|
|
- "shard": 0,
|
|
|
- "state": "STARTED"
|
|
|
+ "shard": 2,
|
|
|
+ "state": "STARTED",
|
|
|
+ "allocation_id": {"id":"Nwl0wbMBTHCWjEEbGYGapg"},
|
|
|
+ "relocating_node": null
|
|
|
}
|
|
|
],
|
|
|
[
|
|
@@ -64,9 +64,10 @@ This will yield the following result:
|
|
|
"index": "twitter",
|
|
|
"node": "JklnKbD7Tyqi9TP3_Q_tBg",
|
|
|
"primary": true,
|
|
|
- "relocating_node": null,
|
|
|
- "shard": 2,
|
|
|
- "state": "STARTED"
|
|
|
+ "shard": 3,
|
|
|
+ "state": "STARTED",
|
|
|
+ "allocation_id": {"id":"bU_KLGJISbW0RejwnwDPKw"},
|
|
|
+ "relocating_node": null
|
|
|
}
|
|
|
],
|
|
|
[
|
|
@@ -74,42 +75,48 @@ This will yield the following result:
|
|
|
"index": "twitter",
|
|
|
"node": "JklnKbD7Tyqi9TP3_Q_tBg",
|
|
|
"primary": true,
|
|
|
- "relocating_node": null,
|
|
|
- "shard": 1,
|
|
|
- "state": "STARTED"
|
|
|
+ "shard": 4,
|
|
|
+ "state": "STARTED",
|
|
|
+ "allocation_id": {"id":"DMs7_giNSwmdqVukF7UydA"},
|
|
|
+ "relocating_node": null
|
|
|
}
|
|
|
]
|
|
|
]
|
|
|
}
|
|
|
--------------------------------------------------
|
|
|
+// TESTRESPONSE[s/"nodes": ...,/"nodes": $body.nodes,/]
|
|
|
+// TESTRESPONSE[s/JklnKbD7Tyqi9TP3_Q_tBg/$body.shards.0.0.node/]
|
|
|
+// TESTRESPONSE[s/0TvkCyF7TAmM1wHP4a42-A/$body.shards.0.0.allocation_id.id/]
|
|
|
+// TESTRESPONSE[s/fMju3hd1QHWmWrIgFnI4Ww/$body.shards.1.0.allocation_id.id/]
|
|
|
+// TESTRESPONSE[s/Nwl0wbMBTHCWjEEbGYGapg/$body.shards.2.0.allocation_id.id/]
|
|
|
+// TESTRESPONSE[s/bU_KLGJISbW0RejwnwDPKw/$body.shards.3.0.allocation_id.id/]
|
|
|
+// TESTRESPONSE[s/DMs7_giNSwmdqVukF7UydA/$body.shards.4.0.allocation_id.id/]
|
|
|
|
|
|
And specifying the same request, this time with a routing value:
|
|
|
|
|
|
[source,js]
|
|
|
--------------------------------------------------
|
|
|
-curl -XGET 'localhost:9200/twitter/_search_shards?routing=foo,baz'
|
|
|
+GET /twitter/_search_shards?routing=foo,baz
|
|
|
--------------------------------------------------
|
|
|
+// CONSOLE
|
|
|
+// TEST[s/^/PUT twitter\n/]
|
|
|
|
|
|
This will yield the following result:
|
|
|
|
|
|
[source,js]
|
|
|
--------------------------------------------------
|
|
|
{
|
|
|
- "nodes": {
|
|
|
- "JklnKbD7Tyqi9TP3_Q_tBg": {
|
|
|
- "name": "Rl'nnd",
|
|
|
- "transport_address": "inet[/192.168.1.113:9300]"
|
|
|
- }
|
|
|
- },
|
|
|
+ "nodes": ...,
|
|
|
"shards": [
|
|
|
[
|
|
|
{
|
|
|
"index": "twitter",
|
|
|
"node": "JklnKbD7Tyqi9TP3_Q_tBg",
|
|
|
"primary": true,
|
|
|
- "relocating_node": null,
|
|
|
- "shard": 2,
|
|
|
- "state": "STARTED"
|
|
|
+ "shard": 0,
|
|
|
+ "state": "STARTED",
|
|
|
+ "allocation_id": {"id":"0TvkCyF7TAmM1wHP4a42-A"},
|
|
|
+ "relocating_node": null
|
|
|
}
|
|
|
],
|
|
|
[
|
|
@@ -117,14 +124,19 @@ This will yield the following result:
|
|
|
"index": "twitter",
|
|
|
"node": "JklnKbD7Tyqi9TP3_Q_tBg",
|
|
|
"primary": true,
|
|
|
- "relocating_node": null,
|
|
|
- "shard": 4,
|
|
|
- "state": "STARTED"
|
|
|
+ "shard": 1,
|
|
|
+ "state": "STARTED",
|
|
|
+ "allocation_id": {"id":"fMju3hd1QHWmWrIgFnI4Ww"},
|
|
|
+ "relocating_node": null
|
|
|
}
|
|
|
]
|
|
|
]
|
|
|
}
|
|
|
--------------------------------------------------
|
|
|
+// TESTRESPONSE[s/"nodes": ...,/"nodes": $body.nodes,/]
|
|
|
+// TESTRESPONSE[s/JklnKbD7Tyqi9TP3_Q_tBg/$body.shards.0.0.node/]
|
|
|
+// TESTRESPONSE[s/0TvkCyF7TAmM1wHP4a42-A/$body.shards.0.0.allocation_id.id/]
|
|
|
+// TESTRESPONSE[s/fMju3hd1QHWmWrIgFnI4Ww/$body.shards.1.0.allocation_id.id/]
|
|
|
|
|
|
This time the search will only be executed against two of the shards, because
|
|
|
routing values have been specified.
|