Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Let's dive in and get Elasticsearch installed on your home PC so you can follow along in this course
if you'd like to.
Now, Elasticsearch is going to be running on a new boot to Linux system for this course, but if you
don't already have a new Bluetooth system sitting around, that's okay.
What we're going to show you is how to install VirtualBox on your Mac or Windows PC and that will allow
you to install Ubuntu running right on your own desktop within a little virtual environment.
Once we have Ubuntu installed inside, VirtualBox will install Elasticsearch on it and after that will
install the complete works of William Shakespeare into Elasticsearch and see if we can successfully
search that.
So that's a lot to do in one lecture, but I'll get you through it.
Let's talk briefly about system requirements.
Pretty much any PC should be able to handle this.
You don't need a ton of resources for Elasticsearch.
If you do run into trouble, however, make sure that you have virtualization enabled in your buyer
settings on your PC and specifically make sure that Hyper-V virtualization is off.
If that's an option in nearby us.
But just try following along first.
You shouldn't need to tinker with your bio settings unless you run into problems.
Also, beware that the antivirus program called Avast is known to conflict with VirtualBox, so you'll
need to switch to a different one or turn it off while using this course if you're going to be using
Avast Antivirus.
With that, let's dive in and get this set up.
So the first thing I'll walk you through is installing VirtualBox and then a virtual image of an A boutique
server.
Now, if you already have an A Bluetooth server that you have access to that you can just play with,
you can skip these next couple of steps.
These steps are intended to get you running and a boon to instance on your desktop in a virtual environment.
But if you have a real one, you don't need to do that.
However, if you do want to run this at home on a windows or a mac PC, you'll want to follow these
steps.
So step one, go to VirtualBox dot org.
And from here you can download whatever the latest version of VirtualBox happens to be.
There should be a big friendly download button here.
So let's go take care of that.
And from here, just download the platform package for your host type.
I'm on Windows, so I'm going to hit Windows hosts.
And as you download the installer for VirtualBox, whatever version it is, go ahead and install that
however you install it on your system.
I'm not going to walk you through the installer process there.
It's pretty straightforward.
Just accept the defaults and you should be fine.
I have already installed VirtualBox on my machine, so I'm going to skip that step.
But if you do need to go and install VirtualBox right now yourself, pause this video and come back
when you're done.
All right.
Now that we have VirtualBox installed, we're going to go and get image for the latest Ubuntu server
image.
And for that we're going to head to OS boxes dawgs ubuntu.
These guys make a very handy dandy service of providing you with pre-built images for VirtualBox for
the latest version of a Bluetooth server so you don't have to go and install a boon to you from scratch
anymore.
So from here, just scroll down to the latest version of A Boon too.
I'm using 22.04 in this particular lecture and there should be a friendly download button there for
VirtualBox.
So make sure you've selected VirtualBox here for the image that you want and hit download.
That is a large download about two and a half gigabytes.
So that will take a little bit of time to come down.
Again, if you are following along at home, hit pause and come back when that's done downloading.
All right.
So you may have noticed that that 64 bit dot seven Z file is in a7z format and that is seven zip.
That is not something that is natively supported by Windows.
So if you're on Windows, you might need to download a utility to allow you to decompress that file.
First one I use is called seven zip.
You can just head over to seven dash zip dawg and from there download the installer for your platform.
Most likely that 64 bit x64 if you're on Windows and if you do need that, go ahead and download that
and install it.
I already have.
Once you have, go ahead and open that up wherever you downloaded it to and you should just be able
to right click on that 64 bit dot seven zip file and go to seven zip and say extract to 64 bit.
And that is a big file that will take a little bit of time.
But hey, that's going pretty quickly, actually.
And once that's done decompressing, we can go ahead and launch VirtualBox and import it.
So go ahead and start up VirtualBox if you're looking for it in your start menu, it's actually under
Oracle, so go to O and under Oracle VM VirtualBox.
You should find it there.
So let's go ahead and import that new image that we just downloaded.
And to do that will hit the big friendly new button here.
And we need to give this a name for Oracle VM VirtualBox.
Let's just call it Elasticsearch.
For lack of a better idea, Elasticsearch eight will be specific.
Make sure that wherever your machine folder is is a drive that has plenty of space available.
As we pointed out, this is a pretty big image and make sure you set the type to Linux and the version
to Ubuntu.
64 bit and then we'll click on next and we'll want a fair amount of memory.
Here I'm on a 16 gigabyte machine, so I'm going to actually allocate half of my available physical
ram to this image, to this virtual machine.
So I'm just gonna bump that up to 81, 92, just, you know, half of whatever you have in your box
is a good place to start from hit next.
And now we're going to use an existing virtual hard disk file just like that, and click on the little
folder icon there and browse through the add icon to wherever we downloaded that too.
So that was in my 64 bit folder that went to 22.04 and we will make sure that's selected and select
choose.
Create.
And we now have an Elasticsearch image here.
Go ahead and make sure that selected and click on the start button and that should spark it up.
So we'll give that a little bit of time to boot up.
And now that it's got a log in, let's go ahead and click on O's boxes dot org.
The password is also OS boxes dot org.
I'll reveal that just to make my point and go ahead and hit enter to sign in.
All right.
So now we have a big friendly Ubuntu instance running here and we can go ahead and start the process
of installing Elasticsearch on it.
Now first of all, we definitely need easy access to a terminal here to play with.
So first thing we're going to do is go to show applications and type in terminal.
Actually, it's sitting right there.
And once that's up, we're going to go ahead and right click on that icon and add it to our favorites
so we don't have to go hunting for it every time.
Now there's a lot of commands we need to type in to do this.
And if you want to cheat, you can head on over to media dot sundog dash soft icon slash s slash install
dot text.
And this will give you a list of all the commands that we're going to enter during this activity to
install Elasticsearch.
So if you want to copy and paste from here, that will save you a little bit of time, but I'll type
them in for you.
Here.
Now, yes.
You could install Elasticsearch from a Docker image or something like that, but not everyone is familiar
with Docker.
So for people that are new to this world, I think it's actually easier to do it this way.
So let's go ahead and get started.
First thing we need to do is install the public signing key for installing Elasticsearch.
And for that we're going to say get dash queue, big o dash space.
There's spaces around that dash a little bit unusual.
HTTPS.
Colon.
Slash slash.
Artifacts.
Dot elastic ico slash.
GPG.
Dash key and uppercase dash.
Elasticsearch.
And we're going to pipe that into pseudo GPG dash dash de armor.
Dash low slash user slash share slash key rings.
Slash Elasticsearch.
Ash keyring dot gpg.
And the password for our sponsors is our sponsors story.
And that step is done.
Next.
We need to install the app to transport https package that's simply sudo after dash get install apt
dash transport dash https.
So far so good.
Next, we need to save the repository definition with echo well quote Deb and then in square brackets
signed dash by equals slash user slash share slash keyrings slash Elasticsearch dash keyring GPG that
we just tallied and square brackets ac setpiece colons slash slash artifacts dot elastic echo.
Slash packages slash eight point X because we're installing Elasticsearch eight slash apt.
Space, stable space main and double quote.
And we will pipe that to pseudo t.
Slash Etsy slash apt slash sources list slash elastic dash eight point x.
A list.
That was quick.
And now we finally install the Elasticsearch debian package itself with sudo apt get update ampersand
ampersand due to apt get install Elasticsearch.
So now we're actually installing Elasticsearch.
Off it goes.
All right.
See, that wasn't so bad.
We now have Elasticsearch installed.
However, we do need to configure it now that it's installed, and to do that will just edit the main
configuration file using pseudo nano slash etsy slash Elasticsearch slash Elasticsearch Part II amp.
And we're gonna go down to no name and uncomment that, first of all.
So delete that little hash sign in front of it under network host.
We're going to find that as well due to the.
There it is, network DOT hosts.
Let's go ahead and change that to 0.0.0.0 because we're going to be running this on our local machine
and not some external host.
Discovery dot c dot hosts also needs to be modified.
Let's uncomment that line as well, and we will change this just to the local host.
So I'm going to delete host two there in the comma and change.
Host one to the local address of 120 7.0.0.1.
All right.
Now, we need to also explicitly disable expect security.
A new thing in Elasticsearch eight is that security is enabled by default.
But we're just running on our own local machine here, our own local virtual machine at that.
So really no need for that.
And it does complicate matters quite a bit when you're learning.
So let's go ahead and find the security setting.
And change that pact on security enabled two false.
Finally, we need to find clusters at initial master nodes.
There it is.
And we're going to change that to no dash one, which is the name of the note that we just gave this
thing.
All right, let's go ahead and save this control oder.
Write it out and control X to exit.
We also need to increase the default timeout for the Elasticsearch service itself because on the laptop,
sometimes this can be a little bit slow and we want to make sure that it doesn't fail.
When you actually spin this up for the first time.
So for that we're going to say pseudo nano slash lib slash system D.
Plus system slash Elasticsearch hacked service and here there should be a timeout start SEC setting.
It's time out.
Stop SEC.
There it is.
Timeout starts.
SEC.
Let's change that from 75 to how about 600 to be safe.
We'll go ahead and save that as well.
Control O2, write it out and control X to exit.
And it's also a good idea to give the permissions that we need to read the actual Elasticsearch logs
if we need to troubleshoot things.
So let's take care of that.
While we're thinking of it, we're just going to say pseudo.
The HMD change mod 755 dash uppercase r slash bar slash log slash elasticsearch.
And Slash.
Now to save ourselves some trouble, we also want to configure Elasticsearch to start automatically
when the system boots up so we don't have to do it every time.
To do that, we'll just say pseudo slash bin slash system control system ctrl.
That is daemon.
Ash reload.
And now we can say pseudo open system control.
Label Elasticsearch.
Dot service.
And now we're ready to start the Elasticsearch service itself, let's say pseudo slash, bin slash,
system control.
Start Elasticsearch start service.
And let that spin up.
All right.
That command succeeded, but we're not really sure if Elasticsearch is ready to rock and roll yet.
So let's check it status for that.
We can say pseudo slash, bin slash system control.
Status.
Plastic search.
Dot service.
And you can see that it is showing as active and running.
So I think we're good to go.
Let's see if we can actually hit it.
Let's head cue to get out of that.
So let's check if Elasticsearch is actually responding to queries.
We're going to use the Curl Command throughout this course to actually send a HTTP restful request to
Elasticsearch itself.
So first we need to install curl with sudo apt install curl.
And now we can use Curl to query our service with just curl to get all uppercase.
120 7.0.0.1 That's our local address column 9200, which is the port that Elasticsearch is running on.
And we got a response.
Very cool.
So Elasticsearch is up and running and responding to our requests here successfully.
That's very cool.
And whenever you just hit Elasticsearch without any parameters of any sort, it just gives you back
this sort of generic response with a tagline that says, you know, for search.
Awesome.
So let's actually do something useful with it now.
All right.
Let's actually install the complete works of William Shakespeare and see if we can query it.
So first, we need to download the complete works of William Shakespeare.
And to do that, start with the first screen here and we'll say sudo w get HDP colon cigar media dot
sundog dash softcore.
That's just my own website slash estate slash shakes dash and mapping dot Jason.
And this is actually the mapping file.
We'll talk about what that is more later on.
But it just tells Elasticsearch about the schema and the data types of what we're importing to it.
We can take a quick peek at it with less shakes, dash mapping, dot JSON and you can see that it's
just saying that we're going to import a speaker, which is a keyword type, a play name, a line ID,
which is an integer, and also the speech number, which is also a type integer.
And those are the various properties that we're going to specify four types.
Q To get out of that, let's go ahead and submit that to Elasticsearch with Curl, Curl Bash, Uppercase
H Double Quote Content.
Dash Type Colon application.
Jason, does it help that this is Jason data that we're submitting?
And don't worry, we'll have a shortcut for avoiding the need to type that every time going forward
that put.
120 7.0.0.1 colon 9200 slash Shakespeare.
That's going to be the name of the index that we're creating for this data.
Dash.
Dash, data.
Dash.
Binary.
Sine shakes, dash mapping dot.
Jason.
All we're doing here is saying that we want to put into the Shakespeare index the JSON data that we're
providing from that file.
And looks like it worked.
We got back in acknowledgement.
That looks good.
And Alice actually download the Shakespeare data itself with sudo w gets htp colon slash slash media
dot sundog dash soft dot com slash s8 slash shakespeare underscore 8.0. json.
And that should download pretty quickly and we'll go ahead and submit that to Elasticsearch for indexing.
And let's take a quick pick out first.
Again, just less Shakespeare, you know, dot JSON and you can see that this is actually the complete
works of William Shakespeare.
So we have every line of every every play here.
You can see, for example, line at 221 is from Henry the fourth and that contains the speaker Prince
Henry saying a good morrow Ned very Shakespearean cue to get out of that let's go ahead and index all
this stuff with col dash uppercase h quote.
Content dash type colon application slash JSON and quote.
Exploit.
Single.
Quote 127.0.0.1 colon 9200 slash shakespeare slash underscore bulk meaning that we're going to do a
bulk insert of many documents at once.
Single quote dash data.
Dash binary at Shakespeare.
Underscore 8.0. Jason.
And as we wait, it's actually in that scene, the entire works of William Shakespeare into our new
Shakespeare index in Elasticsearch.
Pretty cool.
We'll take that.
That was really quick.
All right.
Cool.
So it looks like that worked.
Let's go ahead and try searching for a phrase, shall we?
So let's do a really simple example of issuing a restful query for a search in Elasticsearch.
We'll say Curl Dash H.
Again.
Double quotes.
Content.
A type.
Colon application slash JSON.
S X get this time because we're trying to get data and I put data in single quote.
120 7.0.0.1 colon 9200.
So I Shakespeare.
Slash underscore search telling you that we want to do a search query question mark pretty because we
want it to be human readable and formatted nicely.
Dash ready and then another single quote and hit enter to go to another line.
So far we're just saying that we're going to be querying the Shakespeare index and we're going to do
a search on it of some sort with the following command.
So let's start with a curly bracket.
It's going to be in JSON format.
And here again, quote, query.
Quote, Colon and another curly bracket and we'll say match underscore phrase again in quotes.
Bolan and another curly bracket and quote text underscore entry quotes.
Colon to be or not to be in quotes and I will just close out all those curly brackets with a one, two
and three and finally a single quote to close off that command.
And there we have a result.
Very cool.
So we can see that this came back with a hit on Hamlet.
The play named Hamlet.
The Speaker Hamlet.
And the actual line from that play line number 3.1.64 lines 34 to 30 is to be or not to be.
That is the question.
So very cool.
We actually installed in a Bluetooth virtual machine, we installed Elasticsearch, we configured Elasticsearch
and we actually ran a query on Elasticsearch against the entire works of William Shakespeare successfully.
Pretty cool stuff.
So now that we have that under our belt, I hope you have a little bit of a sense of accomplishment
there and we'll go on and learn more about what we just did and what it all means.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.