Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tutorial-load-dataset.asciidoc #11703

Merged
merged 6 commits into from
May 12, 2017
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions docs/getting-started/tutorial-load-dataset.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,36 +60,35 @@ field's searchability or whether or not it's _tokenized_, or broken up into sepa

Use the following command in a terminal (eg `bash`) to set up a mapping for the Shakespeare data set:

[source,shell]
curl -H 'Content-Type: application/json' -XPUT http://localhost:9200/shakespeare -d '
[source,js]
PUT /shakespeare
{
"mappings" : {
"_default_" : {
"properties" : {
"speaker" : {"type": "string", "index" : "not_analyzed" },
"play_name" : {"type": "string", "index" : "not_analyzed" },
"speaker" : {"type": "keyword" },
"play_name" : {"type": "keyword" },
"line_id" : { "type" : "integer" },
"speech_number" : { "type" : "integer" }
}
}
}
}
';

//CONSOLE

This mapping specifies the following qualities for the data set:

* The _speaker_ field is a string that isn't analyzed. The string in this field is treated as a single unit, even if
there are multiple words in the field.
* The same applies to the _play_name_ field.
* Because, the _speaker_ and _play_name_ fields are keyword fields, they are not analyzed. The strings are treated as a single unit even if they contain multiple words.
* The _line_id_ and _speech_number_ fields are integers.

The logs data set requires a mapping to label the latitude/longitude pairs in the logs as geographic locations by
applying the `geo_point` type to those fields.

Use the following commands to establish `geo_point` mapping for the logs:

[source,shell]
curl -H 'Content-Type: application/json' -XPUT http://localhost:9200/logstash-2015.05.18 -d '
[source,js]
PUT /logstash-2015.05.18
{
"mappings": {
"log": {
Expand All @@ -105,10 +104,11 @@ curl -H 'Content-Type: application/json' -XPUT http://localhost:9200/logstash-20
}
}
}
';

[source,shell]
curl -H 'Content-Type: application/json' -XPUT http://localhost:9200/logstash-2015.05.19 -d '
//CONSOLE

[source,js]
PUT /logstash-2015.05.19
{
"mappings": {
"log": {
Expand All @@ -124,10 +124,11 @@ curl -H 'Content-Type: application/json' -XPUT http://localhost:9200/logstash-20
}
}
}
';

[source,shell]
curl -H 'Content-Type: application/json' -XPUT http://localhost:9200/logstash-2015.05.20 -d '
//CONSOLE

[source,js]
PUT /logstash-2015.05.20
{
"mappings": {
"log": {
Expand All @@ -143,7 +144,8 @@ curl -H 'Content-Type: application/json' -XPUT http://localhost:9200/logstash-20
}
}
}
';

//CONSOLE

The accounts data set doesn't require any mappings, so at this point we're ready to use the Elasticsearch
{es-ref}docs-bulk.html[`bulk`] API to load the data sets with the following commands:
Expand All @@ -157,12 +159,14 @@ These commands may take some time to execute, depending on the computing resourc

Verify successful loading with the following command:

[source,shell]
curl 'localhost:9200/_cat/indices?v'
[source,js]
GET /_cat/indices?v

//CONSOLE

You should see output similar to the following:

[source,shell]
[source,js]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why this one was changed to [source,js]?

health status index pri rep docs.count docs.deleted store.size pri.store.size
yellow open bank 5 1 1000 0 418.2kb 418.2kb
yellow open shakespeare 5 1 111396 0 17.6mb 17.6mb
Expand Down