Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,420 --> 00:00:04,890
Let's dive in and get Elasticsearch installed on your home PC so you can follow along in this course
2
00:00:04,890 --> 00:00:05,490
if you'd like to.
3
00:00:07,290 --> 00:00:11,520
Now, Elasticsearch is going to be running on a new boot to Linux system for this course, but if you
4
00:00:11,520 --> 00:00:14,550
don't already have a new Bluetooth system sitting around, that's okay.
5
00:00:15,180 --> 00:00:20,160
What we're going to show you is how to install VirtualBox on your Mac or Windows PC and that will allow
6
00:00:20,160 --> 00:00:24,300
you to install Ubuntu running right on your own desktop within a little virtual environment.
7
00:00:25,230 --> 00:00:30,450
Once we have Ubuntu installed inside, VirtualBox will install Elasticsearch on it and after that will
8
00:00:30,450 --> 00:00:34,890
install the complete works of William Shakespeare into Elasticsearch and see if we can successfully
9
00:00:34,890 --> 00:00:35,460
search that.
10
00:00:36,240 --> 00:00:38,430
So that's a lot to do in one lecture, but I'll get you through it.
11
00:00:39,690 --> 00:00:41,700
Let's talk briefly about system requirements.
12
00:00:42,120 --> 00:00:44,520
Pretty much any PC should be able to handle this.
13
00:00:44,520 --> 00:00:46,950
You don't need a ton of resources for Elasticsearch.
14
00:00:47,400 --> 00:00:51,210
If you do run into trouble, however, make sure that you have virtualization enabled in your buyer
15
00:00:51,210 --> 00:00:55,920
settings on your PC and specifically make sure that Hyper-V virtualization is off.
16
00:00:56,040 --> 00:00:57,480
If that's an option in nearby us.
17
00:00:58,080 --> 00:00:59,850
But just try following along first.
18
00:01:00,180 --> 00:01:03,330
You shouldn't need to tinker with your bio settings unless you run into problems.
19
00:01:04,349 --> 00:01:10,590
Also, beware that the antivirus program called Avast is known to conflict with VirtualBox, so you'll
20
00:01:10,590 --> 00:01:14,610
need to switch to a different one or turn it off while using this course if you're going to be using
21
00:01:14,610 --> 00:01:15,870
Avast Antivirus.
22
00:01:16,800 --> 00:01:18,420
With that, let's dive in and get this set up.
23
00:01:19,950 --> 00:01:25,020
So the first thing I'll walk you through is installing VirtualBox and then a virtual image of an A boutique
24
00:01:25,050 --> 00:01:25,530
server.
25
00:01:25,890 --> 00:01:29,880
Now, if you already have an A Bluetooth server that you have access to that you can just play with,
26
00:01:29,880 --> 00:01:31,710
you can skip these next couple of steps.
27
00:01:32,190 --> 00:01:36,780
These steps are intended to get you running and a boon to instance on your desktop in a virtual environment.
28
00:01:36,780 --> 00:01:38,850
But if you have a real one, you don't need to do that.
29
00:01:39,330 --> 00:01:43,920
However, if you do want to run this at home on a windows or a mac PC, you'll want to follow these
30
00:01:43,920 --> 00:01:44,240
steps.
31
00:01:44,250 --> 00:01:47,100
So step one, go to VirtualBox dot org.
32
00:01:47,370 --> 00:01:50,940
And from here you can download whatever the latest version of VirtualBox happens to be.
33
00:01:50,940 --> 00:01:53,400
There should be a big friendly download button here.
34
00:01:53,850 --> 00:01:54,960
So let's go take care of that.
35
00:01:55,680 --> 00:01:59,190
And from here, just download the platform package for your host type.
36
00:01:59,190 --> 00:02:01,650
I'm on Windows, so I'm going to hit Windows hosts.
37
00:02:03,440 --> 00:02:08,620
And as you download the installer for VirtualBox, whatever version it is, go ahead and install that
38
00:02:08,630 --> 00:02:10,110
however you install it on your system.
39
00:02:10,130 --> 00:02:12,610
I'm not going to walk you through the installer process there.
40
00:02:12,620 --> 00:02:13,910
It's pretty straightforward.
41
00:02:14,240 --> 00:02:16,070
Just accept the defaults and you should be fine.
42
00:02:16,460 --> 00:02:20,240
I have already installed VirtualBox on my machine, so I'm going to skip that step.
43
00:02:20,240 --> 00:02:24,890
But if you do need to go and install VirtualBox right now yourself, pause this video and come back
44
00:02:24,890 --> 00:02:25,460
when you're done.
45
00:02:26,740 --> 00:02:27,040
All right.
46
00:02:27,160 --> 00:02:32,290
Now that we have VirtualBox installed, we're going to go and get image for the latest Ubuntu server
47
00:02:32,290 --> 00:02:32,650
image.
48
00:02:32,770 --> 00:02:37,210
And for that we're going to head to OS boxes dawgs ubuntu.
49
00:02:37,750 --> 00:02:43,510
These guys make a very handy dandy service of providing you with pre-built images for VirtualBox for
50
00:02:43,510 --> 00:02:48,040
the latest version of a Bluetooth server so you don't have to go and install a boon to you from scratch
51
00:02:48,040 --> 00:02:48,490
anymore.
52
00:02:49,120 --> 00:02:51,500
So from here, just scroll down to the latest version of A Boon too.
53
00:02:51,520 --> 00:02:58,200
I'm using 22.04 in this particular lecture and there should be a friendly download button there for
54
00:02:58,210 --> 00:02:58,940
VirtualBox.
55
00:02:58,960 --> 00:03:03,130
So make sure you've selected VirtualBox here for the image that you want and hit download.
56
00:03:03,580 --> 00:03:06,430
That is a large download about two and a half gigabytes.
57
00:03:06,700 --> 00:03:08,800
So that will take a little bit of time to come down.
58
00:03:09,370 --> 00:03:14,080
Again, if you are following along at home, hit pause and come back when that's done downloading.
59
00:03:16,030 --> 00:03:16,360
All right.
60
00:03:16,360 --> 00:03:22,720
So you may have noticed that that 64 bit dot seven Z file is in a7z format and that is seven zip.
61
00:03:22,780 --> 00:03:25,480
That is not something that is natively supported by Windows.
62
00:03:25,480 --> 00:03:29,920
So if you're on Windows, you might need to download a utility to allow you to decompress that file.
63
00:03:29,930 --> 00:03:32,740
First one I use is called seven zip.
64
00:03:32,740 --> 00:03:38,470
You can just head over to seven dash zip dawg and from there download the installer for your platform.
65
00:03:38,770 --> 00:03:44,710
Most likely that 64 bit x64 if you're on Windows and if you do need that, go ahead and download that
66
00:03:44,710 --> 00:03:45,280
and install it.
67
00:03:45,280 --> 00:03:46,000
I already have.
68
00:03:46,210 --> 00:03:52,870
Once you have, go ahead and open that up wherever you downloaded it to and you should just be able
69
00:03:52,870 --> 00:04:00,220
to right click on that 64 bit dot seven zip file and go to seven zip and say extract to 64 bit.
70
00:04:01,750 --> 00:04:04,300
And that is a big file that will take a little bit of time.
71
00:04:04,300 --> 00:04:06,040
But hey, that's going pretty quickly, actually.
72
00:04:08,610 --> 00:04:13,680
And once that's done decompressing, we can go ahead and launch VirtualBox and import it.
73
00:04:15,700 --> 00:04:19,930
So go ahead and start up VirtualBox if you're looking for it in your start menu, it's actually under
74
00:04:19,930 --> 00:04:23,920
Oracle, so go to O and under Oracle VM VirtualBox.
75
00:04:23,920 --> 00:04:24,940
You should find it there.
76
00:04:28,120 --> 00:04:31,150
So let's go ahead and import that new image that we just downloaded.
77
00:04:31,150 --> 00:04:33,700
And to do that will hit the big friendly new button here.
78
00:04:34,330 --> 00:04:37,900
And we need to give this a name for Oracle VM VirtualBox.
79
00:04:37,900 --> 00:04:40,090
Let's just call it Elasticsearch.
80
00:04:40,090 --> 00:04:43,240
For lack of a better idea, Elasticsearch eight will be specific.
81
00:04:43,990 --> 00:04:48,320
Make sure that wherever your machine folder is is a drive that has plenty of space available.
82
00:04:48,340 --> 00:04:53,830
As we pointed out, this is a pretty big image and make sure you set the type to Linux and the version
83
00:04:53,830 --> 00:04:55,090
to Ubuntu.
84
00:04:57,240 --> 00:05:04,170
64 bit and then we'll click on next and we'll want a fair amount of memory.
85
00:05:04,200 --> 00:05:08,910
Here I'm on a 16 gigabyte machine, so I'm going to actually allocate half of my available physical
86
00:05:08,910 --> 00:05:11,010
ram to this image, to this virtual machine.
87
00:05:11,430 --> 00:05:16,140
So I'm just gonna bump that up to 81, 92, just, you know, half of whatever you have in your box
88
00:05:16,140 --> 00:05:18,900
is a good place to start from hit next.
89
00:05:19,290 --> 00:05:25,410
And now we're going to use an existing virtual hard disk file just like that, and click on the little
90
00:05:25,680 --> 00:05:32,010
folder icon there and browse through the add icon to wherever we downloaded that too.
91
00:05:33,150 --> 00:05:42,750
So that was in my 64 bit folder that went to 22.04 and we will make sure that's selected and select
92
00:05:42,750 --> 00:05:43,440
choose.
93
00:05:46,160 --> 00:05:46,640
Create.
94
00:05:48,110 --> 00:05:50,120
And we now have an Elasticsearch image here.
95
00:05:50,480 --> 00:05:54,350
Go ahead and make sure that selected and click on the start button and that should spark it up.
96
00:05:58,740 --> 00:06:01,200
So we'll give that a little bit of time to boot up.
97
00:06:05,800 --> 00:06:09,790
And now that it's got a log in, let's go ahead and click on O's boxes dot org.
98
00:06:10,300 --> 00:06:13,000
The password is also OS boxes dot org.
99
00:06:14,730 --> 00:06:20,010
I'll reveal that just to make my point and go ahead and hit enter to sign in.
100
00:06:24,270 --> 00:06:24,600
All right.
101
00:06:24,600 --> 00:06:28,620
So now we have a big friendly Ubuntu instance running here and we can go ahead and start the process
102
00:06:28,620 --> 00:06:30,030
of installing Elasticsearch on it.
103
00:06:30,030 --> 00:06:34,440
Now first of all, we definitely need easy access to a terminal here to play with.
104
00:06:34,440 --> 00:06:39,090
So first thing we're going to do is go to show applications and type in terminal.
105
00:06:39,150 --> 00:06:40,170
Actually, it's sitting right there.
106
00:06:42,630 --> 00:06:47,550
And once that's up, we're going to go ahead and right click on that icon and add it to our favorites
107
00:06:47,550 --> 00:06:49,230
so we don't have to go hunting for it every time.
108
00:06:52,090 --> 00:06:54,340
Now there's a lot of commands we need to type in to do this.
109
00:06:54,340 --> 00:07:01,570
And if you want to cheat, you can head on over to media dot sundog dash soft icon slash s slash install
110
00:07:01,570 --> 00:07:02,380
dot text.
111
00:07:02,770 --> 00:07:06,400
And this will give you a list of all the commands that we're going to enter during this activity to
112
00:07:06,400 --> 00:07:08,080
install Elasticsearch.
113
00:07:08,920 --> 00:07:12,460
So if you want to copy and paste from here, that will save you a little bit of time, but I'll type
114
00:07:12,460 --> 00:07:13,030
them in for you.
115
00:07:13,060 --> 00:07:13,300
Here.
116
00:07:13,780 --> 00:07:14,290
Now, yes.
117
00:07:14,290 --> 00:07:19,090
You could install Elasticsearch from a Docker image or something like that, but not everyone is familiar
118
00:07:19,090 --> 00:07:19,600
with Docker.
119
00:07:19,600 --> 00:07:23,620
So for people that are new to this world, I think it's actually easier to do it this way.
120
00:07:24,250 --> 00:07:25,300
So let's go ahead and get started.
121
00:07:25,930 --> 00:07:30,010
First thing we need to do is install the public signing key for installing Elasticsearch.
122
00:07:30,010 --> 00:07:36,160
And for that we're going to say get dash queue, big o dash space.
123
00:07:36,250 --> 00:07:38,220
There's spaces around that dash a little bit unusual.
124
00:07:38,410 --> 00:07:39,130
HTTPS.
125
00:07:39,520 --> 00:07:39,940
Colon.
126
00:07:39,940 --> 00:07:40,600
Slash slash.
127
00:07:40,600 --> 00:07:41,560
Artifacts.
128
00:07:42,760 --> 00:07:45,280
Dot elastic ico slash.
129
00:07:45,280 --> 00:07:45,970
GPG.
130
00:07:45,970 --> 00:07:48,820
Dash key and uppercase dash.
131
00:07:48,910 --> 00:07:49,780
Elasticsearch.
132
00:07:51,720 --> 00:07:56,640
And we're going to pipe that into pseudo GPG dash dash de armor.
133
00:07:58,430 --> 00:08:03,020
Dash low slash user slash share slash key rings.
134
00:08:04,650 --> 00:08:06,180
Slash Elasticsearch.
135
00:08:07,090 --> 00:08:09,340
Ash keyring dot gpg.
136
00:08:11,350 --> 00:08:15,040
And the password for our sponsors is our sponsors story.
137
00:08:17,200 --> 00:08:18,420
And that step is done.
138
00:08:18,430 --> 00:08:18,640
Next.
139
00:08:18,640 --> 00:08:26,140
We need to install the app to transport https package that's simply sudo after dash get install apt
140
00:08:26,140 --> 00:08:29,680
dash transport dash https.
141
00:08:36,400 --> 00:08:37,390
So far so good.
142
00:08:37,840 --> 00:08:46,330
Next, we need to save the repository definition with echo well quote Deb and then in square brackets
143
00:08:46,540 --> 00:08:57,460
signed dash by equals slash user slash share slash keyrings slash Elasticsearch dash keyring GPG that
144
00:08:57,460 --> 00:09:05,500
we just tallied and square brackets ac setpiece colons slash slash artifacts dot elastic echo.
145
00:09:06,750 --> 00:09:12,570
Slash packages slash eight point X because we're installing Elasticsearch eight slash apt.
146
00:09:13,870 --> 00:09:17,530
Space, stable space main and double quote.
147
00:09:17,980 --> 00:09:20,470
And we will pipe that to pseudo t.
148
00:09:21,340 --> 00:09:28,270
Slash Etsy slash apt slash sources list slash elastic dash eight point x.
149
00:09:29,470 --> 00:09:30,190
A list.
150
00:09:33,100 --> 00:09:33,670
That was quick.
151
00:09:34,630 --> 00:09:41,170
And now we finally install the Elasticsearch debian package itself with sudo apt get update ampersand
152
00:09:41,170 --> 00:09:45,910
ampersand due to apt get install Elasticsearch.
153
00:09:45,910 --> 00:09:47,920
So now we're actually installing Elasticsearch.
154
00:09:48,670 --> 00:09:49,480
Off it goes.
155
00:09:55,370 --> 00:09:55,700
All right.
156
00:09:55,700 --> 00:09:56,720
See, that wasn't so bad.
157
00:09:56,750 --> 00:09:58,480
We now have Elasticsearch installed.
158
00:09:58,490 --> 00:10:02,990
However, we do need to configure it now that it's installed, and to do that will just edit the main
159
00:10:02,990 --> 00:10:12,800
configuration file using pseudo nano slash etsy slash Elasticsearch slash Elasticsearch Part II amp.
160
00:10:15,340 --> 00:10:19,290
And we're gonna go down to no name and uncomment that, first of all.
161
00:10:19,300 --> 00:10:23,500
So delete that little hash sign in front of it under network host.
162
00:10:23,500 --> 00:10:26,140
We're going to find that as well due to the.
163
00:10:27,500 --> 00:10:28,850
There it is, network DOT hosts.
164
00:10:29,630 --> 00:10:36,350
Let's go ahead and change that to 0.0.0.0 because we're going to be running this on our local machine
165
00:10:36,740 --> 00:10:38,060
and not some external host.
166
00:10:38,780 --> 00:10:41,720
Discovery dot c dot hosts also needs to be modified.
167
00:10:43,120 --> 00:10:47,830
Let's uncomment that line as well, and we will change this just to the local host.
168
00:10:48,010 --> 00:10:51,310
So I'm going to delete host two there in the comma and change.
169
00:10:51,310 --> 00:10:55,450
Host one to the local address of 120 7.0.0.1.
170
00:10:57,750 --> 00:10:58,150
All right.
171
00:10:58,230 --> 00:11:01,500
Now, we need to also explicitly disable expect security.
172
00:11:01,500 --> 00:11:04,740
A new thing in Elasticsearch eight is that security is enabled by default.
173
00:11:05,070 --> 00:11:08,970
But we're just running on our own local machine here, our own local virtual machine at that.
174
00:11:08,970 --> 00:11:10,590
So really no need for that.
175
00:11:10,590 --> 00:11:12,870
And it does complicate matters quite a bit when you're learning.
176
00:11:12,870 --> 00:11:15,330
So let's go ahead and find the security setting.
177
00:11:16,980 --> 00:11:20,340
And change that pact on security enabled two false.
178
00:11:23,230 --> 00:11:26,260
Finally, we need to find clusters at initial master nodes.
179
00:11:28,370 --> 00:11:29,060
There it is.
180
00:11:30,050 --> 00:11:36,770
And we're going to change that to no dash one, which is the name of the note that we just gave this
181
00:11:36,770 --> 00:11:37,100
thing.
182
00:11:37,940 --> 00:11:41,000
All right, let's go ahead and save this control oder.
183
00:11:41,000 --> 00:11:44,120
Write it out and control X to exit.
184
00:11:45,440 --> 00:11:51,980
We also need to increase the default timeout for the Elasticsearch service itself because on the laptop,
185
00:11:51,980 --> 00:11:55,370
sometimes this can be a little bit slow and we want to make sure that it doesn't fail.
186
00:11:55,670 --> 00:11:57,440
When you actually spin this up for the first time.
187
00:11:57,450 --> 00:12:03,320
So for that we're going to say pseudo nano slash lib slash system D.
188
00:12:05,230 --> 00:12:13,960
Plus system slash Elasticsearch hacked service and here there should be a timeout start SEC setting.
189
00:12:17,920 --> 00:12:18,430
It's time out.
190
00:12:18,430 --> 00:12:19,300
Stop SEC.
191
00:12:20,170 --> 00:12:20,700
There it is.
192
00:12:20,710 --> 00:12:21,340
Timeout starts.
193
00:12:21,340 --> 00:12:21,580
SEC.
194
00:12:21,580 --> 00:12:25,810
Let's change that from 75 to how about 600 to be safe.
195
00:12:25,960 --> 00:12:28,210
We'll go ahead and save that as well.
196
00:12:28,210 --> 00:12:30,880
Control O2, write it out and control X to exit.
197
00:12:32,200 --> 00:12:36,970
And it's also a good idea to give the permissions that we need to read the actual Elasticsearch logs
198
00:12:36,970 --> 00:12:38,180
if we need to troubleshoot things.
199
00:12:38,180 --> 00:12:39,070
So let's take care of that.
200
00:12:39,070 --> 00:12:41,650
While we're thinking of it, we're just going to say pseudo.
201
00:12:42,630 --> 00:12:51,750
The HMD change mod 755 dash uppercase r slash bar slash log slash elasticsearch.
202
00:12:52,650 --> 00:12:53,400
And Slash.
203
00:12:55,440 --> 00:12:59,490
Now to save ourselves some trouble, we also want to configure Elasticsearch to start automatically
204
00:12:59,490 --> 00:13:01,680
when the system boots up so we don't have to do it every time.
205
00:13:02,040 --> 00:13:06,570
To do that, we'll just say pseudo slash bin slash system control system ctrl.
206
00:13:06,570 --> 00:13:08,430
That is daemon.
207
00:13:09,450 --> 00:13:10,290
Ash reload.
208
00:13:13,700 --> 00:13:16,670
And now we can say pseudo open system control.
209
00:13:18,510 --> 00:13:20,220
Label Elasticsearch.
210
00:13:20,610 --> 00:13:21,390
Dot service.
211
00:13:24,650 --> 00:13:30,230
And now we're ready to start the Elasticsearch service itself, let's say pseudo slash, bin slash,
212
00:13:30,230 --> 00:13:31,070
system control.
213
00:13:32,450 --> 00:13:34,910
Start Elasticsearch start service.
214
00:13:37,850 --> 00:13:38,930
And let that spin up.
215
00:13:42,170 --> 00:13:42,470
All right.
216
00:13:42,470 --> 00:13:46,430
That command succeeded, but we're not really sure if Elasticsearch is ready to rock and roll yet.
217
00:13:46,430 --> 00:13:48,410
So let's check it status for that.
218
00:13:48,410 --> 00:13:51,110
We can say pseudo slash, bin slash system control.
219
00:13:52,570 --> 00:13:53,140
Status.
220
00:13:53,830 --> 00:13:54,520
Plastic search.
221
00:13:54,520 --> 00:13:55,180
Dot service.
222
00:13:58,610 --> 00:14:01,220
And you can see that it is showing as active and running.
223
00:14:02,060 --> 00:14:03,020
So I think we're good to go.
224
00:14:03,050 --> 00:14:04,070
Let's see if we can actually hit it.
225
00:14:04,100 --> 00:14:05,450
Let's head cue to get out of that.
226
00:14:06,050 --> 00:14:09,680
So let's check if Elasticsearch is actually responding to queries.
227
00:14:09,980 --> 00:14:15,470
We're going to use the Curl Command throughout this course to actually send a HTTP restful request to
228
00:14:15,470 --> 00:14:16,550
Elasticsearch itself.
229
00:14:16,880 --> 00:14:20,690
So first we need to install curl with sudo apt install curl.
230
00:14:31,300 --> 00:14:37,720
And now we can use Curl to query our service with just curl to get all uppercase.
231
00:14:38,260 --> 00:14:45,390
120 7.0.0.1 That's our local address column 9200, which is the port that Elasticsearch is running on.
232
00:14:46,480 --> 00:14:48,000
And we got a response.
233
00:14:48,010 --> 00:14:48,670
Very cool.
234
00:14:48,700 --> 00:14:53,020
So Elasticsearch is up and running and responding to our requests here successfully.
235
00:14:53,410 --> 00:14:54,340
That's very cool.
236
00:14:54,730 --> 00:14:58,900
And whenever you just hit Elasticsearch without any parameters of any sort, it just gives you back
237
00:14:58,900 --> 00:15:03,160
this sort of generic response with a tagline that says, you know, for search.
238
00:15:03,820 --> 00:15:04,390
Awesome.
239
00:15:04,780 --> 00:15:06,910
So let's actually do something useful with it now.
240
00:15:06,940 --> 00:15:07,240
All right.
241
00:15:07,270 --> 00:15:12,070
Let's actually install the complete works of William Shakespeare and see if we can query it.
242
00:15:12,640 --> 00:15:15,370
So first, we need to download the complete works of William Shakespeare.
243
00:15:15,400 --> 00:15:25,000
And to do that, start with the first screen here and we'll say sudo w get HDP colon cigar media dot
244
00:15:25,000 --> 00:15:27,010
sundog dash softcore.
245
00:15:27,050 --> 00:15:33,730
That's just my own website slash estate slash shakes dash and mapping dot Jason.
246
00:15:34,480 --> 00:15:36,320
And this is actually the mapping file.
247
00:15:36,340 --> 00:15:38,080
We'll talk about what that is more later on.
248
00:15:38,290 --> 00:15:42,280
But it just tells Elasticsearch about the schema and the data types of what we're importing to it.
249
00:15:42,820 --> 00:15:48,190
We can take a quick peek at it with less shakes, dash mapping, dot JSON and you can see that it's
250
00:15:48,190 --> 00:15:54,070
just saying that we're going to import a speaker, which is a keyword type, a play name, a line ID,
251
00:15:54,160 --> 00:15:58,180
which is an integer, and also the speech number, which is also a type integer.
252
00:15:58,270 --> 00:16:02,440
And those are the various properties that we're going to specify four types.
253
00:16:03,010 --> 00:16:08,380
Q To get out of that, let's go ahead and submit that to Elasticsearch with Curl, Curl Bash, Uppercase
254
00:16:08,380 --> 00:16:10,660
H Double Quote Content.
255
00:16:10,660 --> 00:16:13,510
Dash Type Colon application.
256
00:16:14,940 --> 00:16:17,720
Jason, does it help that this is Jason data that we're submitting?
257
00:16:17,760 --> 00:16:21,990
And don't worry, we'll have a shortcut for avoiding the need to type that every time going forward
258
00:16:22,530 --> 00:16:23,460
that put.
259
00:16:24,450 --> 00:16:29,030
120 7.0.0.1 colon 9200 slash Shakespeare.
260
00:16:29,050 --> 00:16:31,900
That's going to be the name of the index that we're creating for this data.
261
00:16:32,440 --> 00:16:32,770
Dash.
262
00:16:32,770 --> 00:16:33,400
Dash, data.
263
00:16:33,400 --> 00:16:33,700
Dash.
264
00:16:33,700 --> 00:16:34,420
Binary.
265
00:16:35,960 --> 00:16:38,570
Sine shakes, dash mapping dot.
266
00:16:38,570 --> 00:16:39,080
Jason.
267
00:16:39,890 --> 00:16:45,290
All we're doing here is saying that we want to put into the Shakespeare index the JSON data that we're
268
00:16:45,290 --> 00:16:46,370
providing from that file.
269
00:16:47,790 --> 00:16:48,960
And looks like it worked.
270
00:16:49,230 --> 00:16:50,610
We got back in acknowledgement.
271
00:16:50,610 --> 00:16:51,150
That looks good.
272
00:16:52,290 --> 00:16:59,430
And Alice actually download the Shakespeare data itself with sudo w gets htp colon slash slash media
273
00:16:59,430 --> 00:17:08,430
dot sundog dash soft dot com slash s8 slash shakespeare underscore 8.0. json.
274
00:17:10,450 --> 00:17:15,880
And that should download pretty quickly and we'll go ahead and submit that to Elasticsearch for indexing.
275
00:17:16,300 --> 00:17:17,770
And let's take a quick pick out first.
276
00:17:17,770 --> 00:17:25,150
Again, just less Shakespeare, you know, dot JSON and you can see that this is actually the complete
277
00:17:25,150 --> 00:17:26,140
works of William Shakespeare.
278
00:17:26,140 --> 00:17:29,800
So we have every line of every every play here.
279
00:17:33,260 --> 00:17:39,710
You can see, for example, line at 221 is from Henry the fourth and that contains the speaker Prince
280
00:17:39,710 --> 00:17:45,380
Henry saying a good morrow Ned very Shakespearean cue to get out of that let's go ahead and index all
281
00:17:45,380 --> 00:17:48,860
this stuff with col dash uppercase h quote.
282
00:17:50,130 --> 00:17:55,020
Content dash type colon application slash JSON and quote.
283
00:17:56,050 --> 00:17:56,570
Exploit.
284
00:17:58,390 --> 00:17:58,720
Single.
285
00:17:58,720 --> 00:18:07,540
Quote 127.0.0.1 colon 9200 slash shakespeare slash underscore bulk meaning that we're going to do a
286
00:18:07,540 --> 00:18:09,880
bulk insert of many documents at once.
287
00:18:10,390 --> 00:18:12,310
Single quote dash data.
288
00:18:12,310 --> 00:18:15,100
Dash binary at Shakespeare.
289
00:18:17,300 --> 00:18:19,670
Underscore 8.0. Jason.
290
00:18:22,770 --> 00:18:27,210
And as we wait, it's actually in that scene, the entire works of William Shakespeare into our new
291
00:18:27,210 --> 00:18:29,160
Shakespeare index in Elasticsearch.
292
00:18:29,880 --> 00:18:30,420
Pretty cool.
293
00:18:31,080 --> 00:18:31,800
We'll take that.
294
00:18:32,100 --> 00:18:33,150
That was really quick.
295
00:18:33,180 --> 00:18:33,510
All right.
296
00:18:33,510 --> 00:18:33,840
Cool.
297
00:18:34,620 --> 00:18:35,760
So it looks like that worked.
298
00:18:36,480 --> 00:18:39,120
Let's go ahead and try searching for a phrase, shall we?
299
00:18:39,570 --> 00:18:44,400
So let's do a really simple example of issuing a restful query for a search in Elasticsearch.
300
00:18:44,430 --> 00:18:45,690
We'll say Curl Dash H.
301
00:18:46,760 --> 00:18:47,120
Again.
302
00:18:47,120 --> 00:18:47,780
Double quotes.
303
00:18:48,440 --> 00:18:49,100
Content.
304
00:18:50,500 --> 00:18:51,220
A type.
305
00:18:52,470 --> 00:18:54,780
Colon application slash JSON.
306
00:18:55,730 --> 00:19:01,250
S X get this time because we're trying to get data and I put data in single quote.
307
00:19:01,250 --> 00:19:05,510
120 7.0.0.1 colon 9200.
308
00:19:05,870 --> 00:19:06,830
So I Shakespeare.
309
00:19:08,570 --> 00:19:13,190
Slash underscore search telling you that we want to do a search query question mark pretty because we
310
00:19:13,190 --> 00:19:15,800
want it to be human readable and formatted nicely.
311
00:19:16,220 --> 00:19:21,620
Dash ready and then another single quote and hit enter to go to another line.
312
00:19:22,310 --> 00:19:26,300
So far we're just saying that we're going to be querying the Shakespeare index and we're going to do
313
00:19:26,300 --> 00:19:28,580
a search on it of some sort with the following command.
314
00:19:28,820 --> 00:19:30,410
So let's start with a curly bracket.
315
00:19:31,010 --> 00:19:32,450
It's going to be in JSON format.
316
00:19:32,900 --> 00:19:35,230
And here again, quote, query.
317
00:19:36,270 --> 00:19:43,800
Quote, Colon and another curly bracket and we'll say match underscore phrase again in quotes.
318
00:19:44,750 --> 00:19:50,570
Bolan and another curly bracket and quote text underscore entry quotes.
319
00:19:51,050 --> 00:20:00,200
Colon to be or not to be in quotes and I will just close out all those curly brackets with a one, two
320
00:20:00,560 --> 00:20:04,010
and three and finally a single quote to close off that command.
321
00:20:06,100 --> 00:20:07,540
And there we have a result.
322
00:20:07,660 --> 00:20:08,440
Very cool.
323
00:20:08,980 --> 00:20:12,940
So we can see that this came back with a hit on Hamlet.
324
00:20:13,690 --> 00:20:14,620
The play named Hamlet.
325
00:20:14,620 --> 00:20:15,470
The Speaker Hamlet.
326
00:20:15,760 --> 00:20:23,740
And the actual line from that play line number 3.1.64 lines 34 to 30 is to be or not to be.
327
00:20:23,980 --> 00:20:25,210
That is the question.
328
00:20:25,870 --> 00:20:26,560
So very cool.
329
00:20:26,560 --> 00:20:32,410
We actually installed in a Bluetooth virtual machine, we installed Elasticsearch, we configured Elasticsearch
330
00:20:32,620 --> 00:20:37,750
and we actually ran a query on Elasticsearch against the entire works of William Shakespeare successfully.
331
00:20:38,200 --> 00:20:39,160
Pretty cool stuff.
332
00:20:39,400 --> 00:20:43,480
So now that we have that under our belt, I hope you have a little bit of a sense of accomplishment
333
00:20:43,480 --> 00:20:47,260
there and we'll go on and learn more about what we just did and what it all means.
30899
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.