-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslides.html
More file actions
483 lines (428 loc) · 21 KB
/
slides.html
File metadata and controls
483 lines (428 loc) · 21 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
<!DOCTYPE html>
<html>
<head>
<title>elasticsearch-slides</title>
<meta charset='utf-8' />
<meta content='width=1024, user-scalable=no' name='viewport' />
<!-- deck.js's core css -->
<link href="deck.js/core/deck.core.css" rel="stylesheet" type="text/css"/>
<!-- deck.js extension CSS files -->
<link href="deck.js/extensions/scale/deck.scale.css" rel="stylesheet" type="text/css"/>
<link href="deck.js/extensions/hash/deck.hash.css" rel="stylesheet" type="text/css"/>
<link href="deck.js/extensions/goto/deck.goto.css" rel="stylesheet" type="text/css"/>
<link href="deck.js/extensions/menu/deck.menu.css" rel="stylesheet" type="text/css"/>
<link href="deck.js/extensions/navigation/deck.navigation.css" rel="stylesheet" type="text/css"/>
<link href="deck.js/extensions/codemirror/deck.codemirror.css" rel="stylesheet" type="text/css"/>
<link href="deck.js/extensions/status/deck.status.css" rel="stylesheet" type="text/css"/>
<!-- all css in the css dir: Keydown CSS, your custom CSS, and themes from deck.js -->
<link href="css/keydown.css" rel="stylesheet" type="text/css"/>
<link href="css/swiss.css" rel="stylesheet" type="text/css"/>
<link href="css/horizontal-slide.css" rel="stylesheet" type="text/css"/>
<link href="css/default.css" rel="stylesheet" type="text/css"/>
<link href="css/mdma-slides.css" rel="stylesheet" type="text/css"/>
<!-- Modernizr (provided for legacy browsers) -->
<script src="deck.js/support/modernizr.custom.js" type="text/javascript"></script>
</head>
<body class='deck-container keydown'>
<section class='full-background slide tree'>
<div class='spacer top'></div>
<div class='content'>
<h1>10+10 minutes intro to Elasticsearch</h1>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Elasticsearch <span style="color:gray">is a</span></h1>
<ul>
<li>multitenant,</li>
<li>(near to) real-time,</li>
<li>distributed</li>
</ul>
<p>index engine based on <strong>Lucene</strong>, that</p>
<ul>
<li>adapts to your domain model (not the other way around)</li>
<li>is easy to setup and</li>
<li>is fully configurable through an HTTP API</li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Elasticsearch</h1>
<ul>
<li><span style="color:gray">was started</span> by the author of Compass, Shay Banon</li>
<li><span style="color:gray">is written</span> in Java</li>
<li><span style="color:gray">is actively developed</span> @<a href="https://github.com/elasticsearch/elasticsearch">github.com/elasticsearch/elasticsearch</a>
<ul>
<li>0.5</li>
<li>0.18</li>
<li>0.19</li>
<li>0.19.4</li>
<li>0.19.5</li>
<li>0.19.8 (July 2, 2012)</li>
</ul>
</li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='LondonEye full-background left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Anatomy of elastic search</h1>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Anatomy 1/3</h1>
<ul>
<li>ElasticSearch runs as a service on your webserver.</li>
<li>If you are running a single server you are running a single ElasticSearch <strong>cluster</strong>.</li>
<li>A single cluster can house the search for more than one site, each of which is stored in an <strong>index</strong>.</li>
<li>Within an index are <strong>types</strong>. These map nicely onto Symphony sections, e.g. articles, products or comments.</li>
<li>ElasticSearch stores <strong>documents</strong> (Symphony entries) which are made up of <strong>fields</strong>.</li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Anatomy 2/3</h1>
<ul>
<li>Fields within a document can be strings, numbers, dates, arrays/collections, or several others.</li>
<li>Although ElasticSearch will automatically create a new type when you throw a new type of document at it. * The structure of a type is known as a <strong>mapping</strong>, and is formatted in a JSON file.</li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Anatomy 3/3</h1>
<ul>
<li>A <strong>query type</strong> is how to query ElasticSearch e.g. text, boolean, wildcard, fuzzy.
<ul>
<li>two main types: <strong>query_string</strong> and <strong>match_all</strong>.</li>
</ul>
</li>
<li><strong>Analysers</strong> are the logic that is run against both the content you are indexing (an entry) and what you are searching for (a keyword).</li>
<li>An analyser comprises a <strong>tokeniser</strong>, which specifies how the tokens (usually words) are broken up (usually based on spaces between words), and <strong>filters</strong>, which work their magic on each word (such as removing stop words, reducing a word to its stem, or replacing with a synonym).</li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Multitenancy</h1>
<ul>
<li>have as many indexes as you want</li>
<li>graylog uses one index per day</li>
<li>finc uses one index per data source</li>
</ul>
<p><textarea class='code' display='none' mode='sh'>$ curl -XPUT localhost:9200/sample_index # create index
$ curl -XPUT localhost:9200/throwaway # create another index
$ curl -XDELETE localhost:9200/throwaway # destroy index</textarea>
</p>
<ul>
<li>search over one or more indexes</li>
</ul>
<p><textarea class='code' display='none' mode='sh'>$ curl -XGET localhost:9200/idx1,idx2/_search?q=Leipzig # search for Leipzig in idx1 and idx2</textarea>
</p>
</div>
<div class='spacer bottom'></div>
</section>
<section class='full-background left rt slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Real-time / <code>refresh_interval</code> at 1s by default</h1>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Distributed</h1>
<ul>
<li>start with one node, add more on the go</li>
<li>control the number of replicas</li>
</ul>
<p><textarea class='code' display='none' mode='sh'>$ curl -XPUT localhost:9200/sample_index/_settings -d '{ "index" : { "number_of_replicas" : 2 }}'</textarea>
</p>
<ul>
<li>automatic load balancing (index, search)</li>
<li>replicas are near real-time too (Push replication)</li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='domain full-background left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Adapts to your domain</h1>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Adapts to your domain</h1>
<ul>
<li>JSON documents</li>
<li>dynamic mapping (without overhead)</li>
<li>mapping templates</li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Easy to setup</h1>
<ul>
<li>you'll need a Java Virtual Machine</li>
<li>then</li>
</ul>
<p><textarea class='code' display='none' mode='shell'>$ wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.4.zip
$ unzip elasticsearch-0.19.4.zip
$ cd elasticsearch-0.19.4
$ bin/elasticsearch -f
[16:25:21,766][INFO ][node ] [Dracula] {0.19.4}[4028]: initializing ...
[16:25:21,775][INFO ][plugins ] [Dracula] loaded [], sites []
[16:25:24,015][INFO ][node ] [Dracula] {0.19.4}[4028]: initialized
[16:25:24,015][INFO ][node ] [Dracula] {0.19.4}[4028]: starting ... 
...
[16:25:27,324][INFO ][gateway ] [Dracula] recovered [3] indices into cluster_state</textarea>
</p>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Easy to setup</h1>
<ul>
<li>index a doc</li>
</ul>
<p><textarea class='code' display='none' mode='shell'>$ curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{
 "user" : "kimchy",
 "post_date" : "2009-11-15T14:12:12",
 "message" : "trying out Elastic Search"
}'</textarea>
</p>
<ul>
<li>search a doc</li>
</ul>
<p><textarea class='code' display='none' mode='shell'>$ curl -XGET 'http://localhost:9200/twitter/tweet/_search?q=user:kimchy'</textarea>
</p>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Configuration via HTTP API</h1>
<ul>
<li><p>prominent settings:</p>
<ul>
<li><code>index.number_of_replicas</code></li>
<li><code>index.refresh_interval</code></li>
<li><code>index.blocks.read_only</code></li>
<li><code>index.merge.policy.merge_factor</code></li>
</ul>
</li>
<li><p>and a lot more (ES + exposed Lucene settings)</p></li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>What others say</h1>
<ul>
<li><p>Solr may be the weapon of choice when building standard search applications, but Elasticsearch takes it to the next level with an architecture for creating modern realtime search applications.</p></li>
<li><p>Percolation is an exciting and innovative feature that singlehandedly blows Solr right out of the water. Elasticsearch is scalable, speedy and a dream to integrate with. (Ryan Sonnek, socialcast)</p></li>
<li><p>more: <a href="http://stackoverflow.com/questions/10213009/solr-vs-elasticsearch">http://stackoverflow.com/questions/10213009/solr-vs-elasticsearch</a>, <a href="http://www.quora.com/What-are-the-main-differences-between-ElasticSearch-Apache-Solr-and-SolrCloud">http://www.quora.com/What-are-the-main-differences-between-ElasticSearch-Apache-Solr-and-SolrCloud</a></p></li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='full-background left percolation slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Percolation?</h1>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Percolation</h1>
<ul>
<li>Think of it as the reverse operation of indexing and then searching</li>
<li>Instead of sending docs, indexing them, and then running queries</li>
<li>One sends queries, registers them, and then sends docs and finds out which queries match that doc</li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Wrap up</h1>
<ul>
<li><p>more features not covered:</p>
<ul>
<li>search / query language</li>
<li>facets</li>
<li>scrolls</li>
</ul>
</li>
<li><p>language bindings:</p>
<ul>
<li>Elasticsearch.pm, PHP, Ruby, Python, Java (native), .NET, Clojure, Erlang</li>
</ul>
</li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>PHP binding:</h1>
<ul>
<li><a href="https://github.com/ruflin/Elastica/wiki/Links">https://github.com/ruflin/Elastica/wiki/Links</a></li>
</ul>
<h1>Symfony bundle:</h1>
<ul>
<li><a href="http://symphonyextensions.com/extensions/elasticsearch">http://symphonyextensions.com/extensions/elasticsearch</a></li>
</ul>
<h1>A must plugin:</h1>
<ul>
<li><a href="http://localhost:9200/_plugin/head">http://localhost:9200/_plugin/head</a></li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='full-background left shutterstock_86440180 slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Demo?</h1>
</div>
<div class='spacer bottom'></div>
</section>
<section class='full-background left palazzotoschi slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Attachment Type in Action <a href="https://gist.github.com/1075067">https://gist.github.com/1075067</a></h1>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<ul>
<li>Download some data</li>
</ul>
<p><textarea class='code' display='none' mode='sh'>curl -C - -O http://www.intersil.com/data/fn/fn6742.pdf</textarea>
</p>
<ul>
<li>Attachments plugin can parse and index documents in many formats. Check Tika web page for list of supported formats.</li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<ul>
<li>Setup mapping (aka prepare new index for the data)</li>
</ul>
<p><textarea class='code' display='none' mode='sh'>curl -X DELETE "localhost:9200/test"

curl -X PUT "localhost:9200/test" -d '{
 "settings" : { "index" : { "number_of_shards" : 1, "number_of_replicas" : 0 }}
}'</textarea>
</p>
<p>Before we can use the attachments plugin we need to create correct mapping for the attachment type.</p>
<p><textarea class='code' display='none' mode='sh'>curl -X PUT "localhost:9200/test/attachment/_mapping" -d '{
 "attachment" : {
 "properties" : {
 "file" : {
 "type" : "attachment",
 "fields" : {
 "title" : { "store" : "yes" },
 "file" : { "term_vector":"with_positions_offsets", "store":"yes" }
 }
 }
 }
 }
}'</textarea>
</p>
</div>
<div class='spacer bottom'></div>
</section>
<section class='Data Indexing left slide the'>
<div class='spacer top'></div>
<div class='content'>
<p>We are ready to index the data. We just need to encode the content of the file with Base64 for which we will use a simpe Perl script.</p>
<p><textarea class='code' display='none' mode='sh'>#!/bin/sh

coded=`cat fn6742.pdf | perl -MMIME::Base64 -ne 'print encode_base64($_)'`
json="{\"file\":\"${coded}\"}"
echo "$json" > json.file
curl -X POST "localhost:9200/test/attachment/" -d @json.file</textarea>
</p>
</div>
<div class='spacer bottom'></div>
</section>
<section class='Highlighted Search for left results slide'>
<div class='spacer top'></div>
<div class='content'>
<ul>
<li>We are done indexing the data and we are now free to search it. To make it even more cool we want the document title and some highlighted results back (note how we setup mapping for the title and file content).</li>
</ul>
<p><textarea class='code' display='none' mode='sh'>curl "localhost:9200/_search?pretty=true" -d '{
 "fields" : ["title"],
 "query" : {
 "query_string" : {
 "query" : "amplifier"
 }
 },
 "highlight" : {
 "fields" : {
 "file" : {}
 }
 }
}'</textarea>
</p>
</div>
<div class='spacer bottom'></div>
</section>
<section class='left slide'>
<div class='spacer top'></div>
<div class='content'>
<h1>Credits</h1>
<ul>
<li>http://www.flickr.com/photos/catdancing/4652800293/</li>
<li>http://www.flickr.com/photos/andreaskoller/154706613/</li>
<li>http://www.flickr.com/photos/ddebold/3738709697/</li>
</ul>
</div>
<div class='spacer bottom'></div>
</section>
<!-- deck.js navigation extension -->
<a class='deck-prev-link' href='#' title='Previous'>←</a>
<a class='deck-next-link' href='#' title='Next'>→</a>
<!-- deck.js hash extension -->
<a class='deck-permalink' href='.' title='Permalink to this slide'>#</a>
<!-- deck.js status extension -->
<p class='deck-status'>
<span class='deck-status-current'></span>
/
<span class='deck-status-total'></span>
</p>
<!-- jQuery & deck.js -->
<script src="deck.js/support/jquery.1.6.4.min.js" type="text/javascript"></script>
<script src="deck.js/core/deck.core.js" type="text/javascript"></script>
<!-- deck.js extension JS files -->
<script src="deck.js/extensions/scale/deck.scale.js" type="text/javascript"></script>
<script src="deck.js/extensions/hash/deck.hash.js" type="text/javascript"></script>
<script src="deck.js/extensions/goto/deck.goto.js" type="text/javascript"></script>
<script src="deck.js/extensions/menu/deck.menu.js" type="text/javascript"></script>
<script src="deck.js/extensions/navigation/deck.navigation.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/codemirror.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/lua/lua.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/scheme/scheme.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/stex/stex.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/javascript/javascript.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/plsql/plsql.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/smalltalk/smalltalk.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/xml/xml.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/sparql/sparql.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/r/r.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/php/php.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/coffeescript/coffeescript.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/htmlmixed/htmlmixed.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/haskell/haskell.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/diff/diff.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/xmlpure/xmlpure.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/python/python.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/clojure/clojure.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/ruby/ruby.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/rst/rst.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/velocity/velocity.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/css/css.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/clike/clike.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/mode/yaml/yaml.js" type="text/javascript"></script>
<script src="deck.js/extensions/codemirror/deck.codemirror.js" type="text/javascript"></script>
<script src="deck.js/extensions/status/deck.status.js" type="text/javascript"></script>
<!-- your custom JS here, including call to initialize deck.js-codemirror -->
<script src="js/mdma-slides.js" type="text/javascript"></script>
<!-- Initialize the deck. -->
<script type='text/javascript'>
$(function() { $.deck('.slide'); });
</script>
</body>
</html>