-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelasticcommands.txt
More file actions
118 lines (93 loc) · 4.47 KB
/
Copy pathelasticcommands.txt
File metadata and controls
118 lines (93 loc) · 4.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
=> Cluster Health
mahtab@LAPTOP-QM32K7CA MINGW64 /
$ curl -X GET "localhost:9200/_cat/health?v&pretty"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 296 100 296 0 0 22769 0 --:--:-- --:--:-- --:--:-- 22769epoch
timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1580225796 15:36:36 elasticsearch green 1 1 0 0 0 0 0 0 - 100.0%
******************************************************************************
=> List All Indices
mahtab@LAPTOP-QM32K7CA MINGW64 /
$ curl -X GET "localhost:9200/_cat/indices?v&pretty"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 83 100 83 0 0 10375 0 --:--:-- --:--:-- --:--:-- 11857
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
******************************************************************************
=> Create an Index
mahtab@LAPTOP-QM32K7CA MINGW64 /
$ curl -X PUT "localhost:9200/customer?pretty&pretty"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 84 100 84 0 0 646 0 --:--:-- --:--:-- --:--:-- 646{
"acknowledged" : true,
"shards_acknowledged" : true,
"index" : "customer"
}
=> List All Indices
mahtab@LAPTOP-QM32K7CA MINGW64 /
$ curl -X GET "localhost:9200/_cat/indices?v&pretty"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 208 100 208 0 0 8320 0 --:--:-- --:--:-- --:--:-- 8666
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open customer OCmLIy4yQE69z7O6Zf7ykQ 1 1 0 0 230b 230b
******************************************************************************
=> Index and Query a Document
mahtab@LAPTOP-QM32K7CA MINGW64 /
$ curl -X PUT "localhost:9200/customer/_doc/1?pretty&pretty" -H 'Content-Type: application/json' -d'
> {
> "name": "John Doe"
> }
> '
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 248 100 222 100 26 4036 472 --:--:-- --:--:-- --:--:-- 4592{
"_index" : "customer",
"_type" : "_doc",
"_id" : "1",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1
}
=> Retrieve that Document
mahtab@LAPTOP-QM32K7CA MINGW64 /
$ curl -X GET "localhost:9200/customer/_doc/1?pretty&pretty"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 3607 0 --:--:-- --:--:-- --:--:-- 3680{
"_index" : "customer",
"_type" : "_doc",
"_id" : "1",
"_version" : 1,
"_seq_no" : 0,
"_primary_term" : 1,
"found" : true,
"_source" : {
"name" : "John Doe"
}
}
******************************************************************************
=> Delete an Index
mahtab@LAPTOP-QM32K7CA MINGW64 /
$ curl -X DELETE "localhost:9200/customer?pretty&pretty"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 28 100 28 0 0 583 0 --:--:-- --:--:-- --:--:-- 583{
"acknowledged" : true
}
=> List All the Indexes
mahtab@LAPTOP-QM32K7CA MINGW64 /
$ curl -X GET "localhost:9200/_cat/indices?v&pretty"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 83 100 83 0 0 7545 0 --:--:-- --:--:-- --:--:-- 8300
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
******************************************************************************