Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit b299918

Browse files
Edits to the intro chapter, and added snippets.
1 parent f432763 commit b299918

21 files changed

+734
-786
lines changed

010_Intro/05_What_is_it.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ https://lucene.apache.org/core/[Apache Lucene(TM)] , a full-text search engine
33
library. Lucene is arguably the most advanced, performant and fully-featured
44
search engine library in existence today -- both open source and proprietary.
55

6-
But Lucene is just a library. To leverage its power you need to work in Java
6+
But, Lucene is just a library. To leverage its power you need to work in Java
77
and to integrate Lucene directly with your application. Worse, you will likely
88
require a degree in Information Retrieval to understand how it works. Lucene
99
is *very* complex.

010_Intro/10_Installing_ES.asciidoc

+37-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
=== Starting Elasticsearch
1+
=== Installing Elasticsearch
22

33
The easiest way to understand what Elasticsearch can do for you is to
44
play with it, so let's get started!
@@ -8,7 +8,7 @@ Preferably, you should install the latest version of the official Java
88
from http://www.java.com[www.java.com].
99

1010
You can download the latest version of Elasticsearch from
11-
http://www.elasticsearch.org/download/.
11+
http://www.elasticsearch.org/download/[elasticsearch.org/download].
1212

1313
[source,js]
1414
--------------------------------------------------
@@ -17,22 +17,45 @@ unzip elasticsearch-$VERSION.zip
1717
cd elasticsearch-$VERSION
1818
--------------------------------------------------
1919

20-
Let's also install link:http://www.elasticsearch.org/overview/marvel/[Marvel], a
21-
cluster management and monitoring plugin developed by Elasticsearch. Once
22-
installed, all the code snippets in this book will display a _"View in Sense"_ link.
23-
Clicking this link will load the code into Sense -- an interactive console
24-
inside of Marvel -- and allow you to follow the example using your Elasticsearch
25-
installation.
20+
TIP: When installing Elasticsearch in production, you can use the method
21+
described above, or the Debian or RPM packages provided on the
22+
http://www.elasticsearch.org/downloads[downloads page]. You can also use
23+
the officially supported
24+
https://github.com/elasticsearch/puppet-elasticsearch[Puppet module] or
25+
https://github.com/elasticsearch/cookbook-elasticsearch[Chef cookbook].
2626

27-
Loading samples in Sense will allow you to play with live data and searches,
28-
fiddle with parameters and generally make the book much more interactive.
27+
[[marvel]]
28+
==== Installing Marvel
2929

30-
[source,js]
30+
http://www.elasticsearch.com/marvel[Marvel] is a management and monitoring
31+
tool for Elasticsearch which is free for develoment use. It comes with an
32+
interactive console called Sense which makes it very easy to talk to
33+
Elasticsearch directly from your browser.
34+
35+
Many of the code examples in this book include a ``View in Sense'' link. When
36+
clicked, it will open up a working example of the code in the Sense console.
37+
You do not have to install Marvel, but it will make this book much more
38+
interactive by allowing you to experiment with the code samples on your local
39+
Elasticsearch cluster.
40+
41+
Marvel is available as a plugin. To download and install it, run this command
42+
in the Elasticsearch directory:
43+
44+
[source,sh]
3145
--------------------------------------------------
3246
./bin/plugin -i elasticsearch/marvel/latest
47+
--------------------------------------------------
48+
49+
You probably don't want Marvel to monitor your local cluster, so you can
50+
disable data collection with this command:
51+
52+
[source,sh]
53+
--------------------------------------------------
3354
echo 'marvel.agent.enabled: false' >> ./config/elasticsearch.yml
3455
--------------------------------------------------
3556

57+
=== Running Elasticsearch
58+
3659
Elasticsearch is now ready to run. You can start it up in the foreground
3760
with:
3861

@@ -58,12 +81,13 @@ You should see a response like this:
5881
"status": 200,
5982
"name": "Shrunken Bones",
6083
"version": {
61-
"number": "1.0.0",
62-
"lucene_version": "4.6.1"
84+
"number": "1.1.0",
85+
"lucene_version": "4.7"
6386
},
6487
"tagline": "You Know, for Search"
6588
}
6689
--------------------------------------------------
90+
// SENSE: 010_Intro/10_Info.json
6791

6892
This means that your Elasticsearch _cluster_ is up and running, and we can
6993
start experimenting with it.

010_Intro/15_API.asciidoc

+7-4
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ curl -XGET 'http://localhost:9200/_count?pretty' -d '
6161
}
6262
'
6363
--------------------------------------------------
64-
<1> The appropriate HTTP method or ``verb'': `GET`, `POST`, `PUT`, `HEAD` or
64+
<1> The appropriate HTTP _method_ or _verb_: `GET`, `POST`, `PUT`, `HEAD` or
6565
`DELETE`
6666
<2> The protocol, hostname and port of any node in the cluster.
6767
<3> The path of the request.
6868
<4> Any optional query string parameters, eg `?pretty` will _pretty-print_
69-
the JSON response to make it easier to read
70-
<5> A JSON encoded request body (if the request needs one)
69+
the JSON response to make it easier to read.
70+
<5> A JSON encoded request body (if the request needs one).
7171

7272
Elasticsearch returns an HTTP status code like `200 OK` and (except for `HEAD`
7373
requests) a JSON encoded response body. The above `curl` request would respond
@@ -120,5 +120,8 @@ GET /_count
120120
}
121121
}
122122
--------------------------------------------------
123+
// SENSE: 010_Intro/15_Count.json
123124

124-
TODO: Link to the Sense plugin?
125+
In fact, this is the same format that is used by the Sense console that we
126+
installed with <<marvel,Marvel>>. You can open and run this code example in
127+
Sense by clicking the ``View in Sense'' link above.

010_Intro/20_Document.asciidoc

+16-15
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=== Document oriented
22

33
Objects in an application are seldom just a simple list of keys and values.
4-
More often than not they are complex data structures which may contain other
5-
dates, geo-locations, objects, or arrays of values.
4+
More often than not they are complex data structures which may contain dates,
5+
geo-locations, objects, or arrays of values.
66

77
Sooner or later you're going to want to store these objects in a database.
88
Trying to do this with the rows and columns of a relational database is the
@@ -13,17 +13,18 @@ retrieve it.
1313

1414
Elasticsearch is _document oriented_, meaning that it stores entire objects or
1515
_documents_. Not only does it store them, it also *indexes* the contents of
16-
each document. In Elasticsearch, you index, search, sort and filter
17-
documents... not rows of columnar data. This is a fundamentally different
18-
way of thinking about data and is one of the reasons Elasticsearch can
19-
perform complex full text search.
16+
each document in order to make them searchable. In Elasticsearch, you index,
17+
search, sort and filter documents... not rows of columnar data. This is a
18+
fundamentally different way of thinking about data and is one of the reasons
19+
Elasticsearch can perform complex full text search.
2020

2121
==== JSON
2222

23-
Elasticsearch uses _JSON_ (or JavaScript Object Notation ) as the
24-
serialization format for documents. JSON serialization is supported by most
25-
programming languages, and has become the standard format used by the NoSQL
26-
movement. It is simple, concise and easy to read.
23+
Elasticsearch uses http://en.wikipedia.org/wiki/Json[_JSON_] (or JavaScript
24+
Object Notation ) as the serialization format for documents. JSON
25+
serialization is supported by most programming languages, and has become the
26+
standard format used by the NoSQL movement. It is simple, concise and easy to
27+
read.
2728

2829
Consider this JSON document which represents a user object:
2930

@@ -51,10 +52,10 @@ a flat table structure.
5152
**************************************************
5253
5354
Almost all languages have modules which will convert arbitrary data
54-
structures into JSON for you, but the details are specific to each language.
55-
Look for modules which handle JSON __ ``serialization'' __
56-
or __ ``marshalling'' __.
57-
http://www.elasticsearch.org/guide[The official Elasticsearch clients] all
58-
handle conversion to and from JSON for you automatically.
55+
structures or objects into JSON for you, but the details are specific to each
56+
language. Look for modules which handle JSON __ ``serialization'' __ or __
57+
``marshalling'' __. http://www.elasticsearch.org/guide[The official
58+
Elasticsearch clients] all handle conversion to and from JSON for you
59+
automatically.
5960
6061
**************************************************

010_Intro/25_CRUD.asciidoc

-138
This file was deleted.

0 commit comments

Comments
 (0)