rabbit-slide-kenhys-groonga-meetup-20140429 2014.04.29.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rabbit +2 -0
- data/README.rd +26 -0
- data/Rakefile +17 -0
- data/config.yaml +18 -0
- data/groonga-meetup-20140429.rab +614 -0
- data/images/bohdi-select-menu.png +0 -0
- data/images/bohdi-what-is-karma.png +0 -0
- data/images/bohdi-works-for-me.png +0 -0
- data/pdf/groonga-meetup-20140429-groonga-meetup-20140429.pdf +0 -0
- metadata +69 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1bf670b520b76d7c75e0b9f56aca873304e71db0
|
4
|
+
data.tar.gz: d86a7474ced5e06fa080fef72ce4467ac48626dc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 12e6c310f34c87801b1cc60810280f03c72b3318c8a1baa140608a793cecc49f7e4326df72184c9027cd0fd335db92684c4ab2b1617495bfb0d9c58b00544062
|
7
|
+
data.tar.gz: 284d94a44abde0b027b2ea24647664ae5f8d2cfad2641c3dd9d418486d6d34c45b54739e96db52a6f0045d7599b9f3663592e0ef20a63a4d24e5ac15afcb8a3a
|
data/.rabbit
ADDED
data/README.rd
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
= Groonga Meetup 2014/04/29
|
2
|
+
|
3
|
+
2014年4月29日に行われたGroonga meetupで使用したスライドです。
|
4
|
+
GroongaやMroongaを初めて触れる人向けに演習を通じて基本をおさえてもらうための資料です。
|
5
|
+
今回は主にGroonga中心のサンプルを用意しました。
|
6
|
+
|
7
|
+
== For author
|
8
|
+
|
9
|
+
=== Show
|
10
|
+
|
11
|
+
rake
|
12
|
+
|
13
|
+
=== Publish
|
14
|
+
|
15
|
+
rake publish
|
16
|
+
|
17
|
+
== For viewers
|
18
|
+
|
19
|
+
=== Install
|
20
|
+
|
21
|
+
gem install rabbit-slide-kenhys-groonga-meetup-20140429
|
22
|
+
|
23
|
+
=== Show
|
24
|
+
|
25
|
+
rabbit rabbit-slide-kenhys-groonga-meetup-20140429.gem
|
26
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require "rabbit/task/slide"
|
2
|
+
|
3
|
+
# Edit ./config.yaml to customize meta data
|
4
|
+
|
5
|
+
spec = nil
|
6
|
+
Rabbit::Task::Slide.new do |task|
|
7
|
+
spec = task.spec
|
8
|
+
# task.spec.files += Dir.glob("doc/**/*.*")
|
9
|
+
# task.spec.files -= Dir.glob("private/**/*.*")
|
10
|
+
# task.spec.add_runtime_dependency("YOUR THEME")
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Tag #{spec.version}"
|
14
|
+
task :tag do
|
15
|
+
sh("git", "tag", "-a", spec.version.to_s, "-m", "Publish #{spec.version}")
|
16
|
+
sh("git", "push", "--tags")
|
17
|
+
end
|
data/config.yaml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
id: groonga-meetup-20140429
|
3
|
+
base_name: groonga-meetup-20140429
|
4
|
+
tags: []
|
5
|
+
presentation_date: 2014/04/29
|
6
|
+
version: 2014.04.29.1
|
7
|
+
licenses: []
|
8
|
+
slideshare_id: groonga-meetup-20140429
|
9
|
+
speaker_deck_id:
|
10
|
+
ustream_id:
|
11
|
+
vimeo_id:
|
12
|
+
author:
|
13
|
+
markup_language:
|
14
|
+
name: HAYASHI Kentaro
|
15
|
+
email: hayashi@clear-code.com
|
16
|
+
rubygems_user: kenhys
|
17
|
+
slideshare_user: kenhys
|
18
|
+
speaker_deck_user:
|
@@ -0,0 +1,614 @@
|
|
1
|
+
= Groonga meetup #2
|
2
|
+
|
3
|
+
: author
|
4
|
+
林健太郎
|
5
|
+
: institution
|
6
|
+
クリアコード
|
7
|
+
: content-source
|
8
|
+
Groonga meetup
|
9
|
+
: date
|
10
|
+
2014/04/29
|
11
|
+
: allotted-time
|
12
|
+
90m
|
13
|
+
: theme
|
14
|
+
.
|
15
|
+
|
16
|
+
= はじめに
|
17
|
+
|
18
|
+
* 開催の目的
|
19
|
+
* 今回の内容
|
20
|
+
* Any Questions?
|
21
|
+
|
22
|
+
= 開催の目的(1)
|
23
|
+
|
24
|
+
「全文検索をしたい人の最初の一歩を踏みだしやすくしよう」
|
25
|
+
|
26
|
+
= 今回の内容(1)
|
27
|
+
|
28
|
+
* 全文検索事始め
|
29
|
+
* GroongaやMroongaの特長の紹介
|
30
|
+
* 最新版の導入について
|
31
|
+
* GroongaやMroongaの環境構築
|
32
|
+
|
33
|
+
= 今回の内容(2)
|
34
|
+
|
35
|
+
* 題材の説明と実際の演習(随時)
|
36
|
+
* Any Questions?
|
37
|
+
|
38
|
+
= 全文検索事始め
|
39
|
+
|
40
|
+
* 既存のシステムに全文検索導入したい
|
41
|
+
* 手持ちのメタ情報を効率良く検索したい
|
42
|
+
|
43
|
+
= Groongaの特長(1)
|
44
|
+
|
45
|
+
* 全文検索と即時更新
|
46
|
+
* 参照ロックフリー
|
47
|
+
* 更新しつつ検索OK
|
48
|
+
* カラムストアを採用
|
49
|
+
* 集計クエリを高速に処理可能
|
50
|
+
|
51
|
+
= Groongaの特長(2)
|
52
|
+
|
53
|
+
* 豊富なトークナイザー
|
54
|
+
* 検索漏れないことを重視しますか?
|
55
|
+
* 検索精度を重視しますか?
|
56
|
+
* 位置情報検索のサポート
|
57
|
+
|
58
|
+
= Groongaの特長(3)
|
59
|
+
|
60
|
+
* アプリケーションへの組込み
|
61
|
+
* ライブラリとして活用可能
|
62
|
+
* 実はバックエンドでGroongaが動いていることも
|
63
|
+
|
64
|
+
= Groongaとパッケージ
|
65
|
+
|
66
|
+
* Debian
|
67
|
+
* Ubuntu
|
68
|
+
* CentOS
|
69
|
+
* Fedora
|
70
|
+
* Windows
|
71
|
+
|
72
|
+
= Groonga on Debian
|
73
|
+
|
74
|
+
* Debian 7.4 (wheezy)
|
75
|
+
* Debian 8 (jessie)
|
76
|
+
* Debian unstable (sid)
|
77
|
+
|
78
|
+
= Groonga on Ubuntu(1)
|
79
|
+
|
80
|
+
* Ubuntu 12.04 (Precise)
|
81
|
+
* Ubuntu 12.10 (Quantal)
|
82
|
+
* 明日でサポート終了 4.0.1まで
|
83
|
+
* Ubuntu 13.04 (Raring)
|
84
|
+
* すでにサポート終了 3.1.2まで
|
85
|
+
|
86
|
+
= Groonga on Ubuntu(2)
|
87
|
+
|
88
|
+
* Ubuntu 13.10 (Saucy)
|
89
|
+
* 7月にサポート終了
|
90
|
+
* Ubuntu 14.04 (Trusty)
|
91
|
+
* 今月からサポート開始
|
92
|
+
|
93
|
+
= Groonga on CentOS
|
94
|
+
|
95
|
+
* CentOS 5/6
|
96
|
+
* 中国語のトークナイザーは未サポート
|
97
|
+
* CentOS 7?
|
98
|
+
* まだrcベースらしいのでしばらく先
|
99
|
+
|
100
|
+
= Groonga on Fedora(1)
|
101
|
+
|
102
|
+
* Fedora 20
|
103
|
+
* 中国語のトークナイザーは未サポート
|
104
|
+
* Groonga公式とFedora公式に違いはない
|
105
|
+
* Fedoraでリリースするのはちょっと遅れる(2-3週)
|
106
|
+
|
107
|
+
= Groonga on Fedora(2)
|
108
|
+
|
109
|
+
* リリース短縮にはKarmaが必要
|
110
|
+
|
111
|
+
# image
|
112
|
+
# src = images/bohdi-what-is-karma.png
|
113
|
+
# relative_height = 100
|
114
|
+
|
115
|
+
= FedoraでKarmaを稼ぐ
|
116
|
+
|
117
|
+
* (('tag:x-small'))Bohdiにログイン
|
118
|
+
* (('tag:x-small'))メニューのTestingを選択
|
119
|
+
* (('tag:x-small'))Groongaパッケージを選択
|
120
|
+
* (('tag:x-small'))works for meコメントを追加
|
121
|
+
|
122
|
+
https://admin.fedoraproject.org/updates/
|
123
|
+
|
124
|
+
= FedoraでKarmaを稼ぐ(1)
|
125
|
+
|
126
|
+
* (('tag:x-small'))((*Bohdiにログイン*))
|
127
|
+
* (('tag:x-small'))メニューのTestingを選択
|
128
|
+
* (('tag:x-small'))Groongaパッケージを選択
|
129
|
+
* (('tag:x-small'))works for meコメントを追加
|
130
|
+
|
131
|
+
https://admin.fedoraproject.org/updates/
|
132
|
+
|
133
|
+
= FedoraでKarmaを稼ぐ(2)
|
134
|
+
|
135
|
+
* (('tag:x-small'))Bohdiにログイン
|
136
|
+
* (('tag:x-small'))((*メニューのTestingを選択*))
|
137
|
+
* (('tag:x-small'))Groongaパッケージを選択
|
138
|
+
* (('tag:x-small'))works for meコメントを追加
|
139
|
+
|
140
|
+
= FedoraでKarmaを稼ぐ(2)
|
141
|
+
|
142
|
+
* Testingって?
|
143
|
+
|
144
|
+
# image
|
145
|
+
# src = images/bohdi-select-menu.png
|
146
|
+
# relative_height = 100
|
147
|
+
|
148
|
+
= FedoraでKarmaを稼ぐ(3)
|
149
|
+
|
150
|
+
* (('tag:x-small'))Bohdiにログイン
|
151
|
+
* (('tag:x-small'))メニューのTestingを選択
|
152
|
+
* (('tag:x-small'))((*Groongaパッケージを選択*))
|
153
|
+
* (('tag:x-small'))works for meコメントを追加
|
154
|
+
|
155
|
+
= FedoraでKarmaを稼ぐ(4)
|
156
|
+
|
157
|
+
* (('tag:x-small'))Bohdiにログイン
|
158
|
+
* (('tag:x-small'))メニューのTestingを選択
|
159
|
+
* (('tag:x-small'))Groongaパッケージを選択
|
160
|
+
* (('tag:x-small'))((*works for meコメントを追加*))
|
161
|
+
|
162
|
+
= FedoraでKarmaを稼ぐ(4)
|
163
|
+
|
164
|
+
* works for meコメントって?
|
165
|
+
* これを送信するとKarma +1
|
166
|
+
|
167
|
+
# image
|
168
|
+
# src = images/bohdi-works-for-me.png
|
169
|
+
# relative_height = 100
|
170
|
+
|
171
|
+
= Mroongaの特長(1)
|
172
|
+
|
173
|
+
* 導入しやすいプラグイン形式
|
174
|
+
* 他のストレージエンジンとの連携
|
175
|
+
* ラッパーモード
|
176
|
+
|
177
|
+
= Mroongaの特長(2)
|
178
|
+
|
179
|
+
* データ更新が多くても検索性能が良い
|
180
|
+
* LIKEからの置き換えも比較的容易
|
181
|
+
|
182
|
+
= Mroongaとパッケージ
|
183
|
+
|
184
|
+
* Debian
|
185
|
+
* Ubuntu
|
186
|
+
* CentOS
|
187
|
+
* Fedora
|
188
|
+
* Windows
|
189
|
+
|
190
|
+
= Mroonga on Debian
|
191
|
+
|
192
|
+
* MySQL 5.5系
|
193
|
+
* Debian 7.4 (wheezy)
|
194
|
+
* Debian 8 (jessie)
|
195
|
+
* Debian unstable (sid)
|
196
|
+
|
197
|
+
= Mroonga on Ubuntu(1)
|
198
|
+
|
199
|
+
* MySQL 5.5系
|
200
|
+
* Ubuntu 12.04 (Precise)
|
201
|
+
* Ubuntu 12.10 (Quantal)
|
202
|
+
* 明日でサポート終了 4.01まで
|
203
|
+
* Ubuntu 13.04 (Raring)
|
204
|
+
* すでにサポート終了 3.12まで
|
205
|
+
|
206
|
+
= Mroonga on Ubuntu(2)
|
207
|
+
|
208
|
+
* MySQL 5.5系
|
209
|
+
* Ubuntu 13.10 (Saucy)
|
210
|
+
* 7月にサポート終了
|
211
|
+
* Ubuntu 14.04 (Trusty)
|
212
|
+
* 今月からサポート開始
|
213
|
+
|
214
|
+
= Mroonga on CentOS 5
|
215
|
+
|
216
|
+
* CentOS 5
|
217
|
+
* 以前はMySQLが古すぎたので、MySQL 5.6対応パッケージを提供
|
218
|
+
* MySQL 5.5(SCL)対応パッケージに移行
|
219
|
+
|
220
|
+
= Mroonga on CentOS 6
|
221
|
+
|
222
|
+
* CentOS 6
|
223
|
+
* MySQL 5.1しか使えないというのは古い情報です!
|
224
|
+
* MySQL 5.5対応(SCL)パッケージに移行
|
225
|
+
|
226
|
+
= Mroonga on CentOS
|
227
|
+
|
228
|
+
* CentOS 5やCentOS 6でMySQL 5.6
|
229
|
+
* wingリポジトリをお勧めしています
|
230
|
+
|
231
|
+
http://wing-repo.net/
|
232
|
+
|
233
|
+
= Mroonga on Fedora
|
234
|
+
|
235
|
+
* Fedora 20
|
236
|
+
* MySQL 5.5 & MariaDB 5.5対応
|
237
|
+
* Fedora公式リポジトリでは未リリース
|
238
|
+
* Mroonga含めてインストールしたいならGroongaリポジトリを登録する
|
239
|
+
|
240
|
+
= 環境構築してみよう
|
241
|
+
|
242
|
+
* Groongaのインストール
|
243
|
+
* Mroongaのインストール
|
244
|
+
|
245
|
+
= (('tag:x-small'))どれをインストールしたらいい?(1)
|
246
|
+
|
247
|
+
* groonga
|
248
|
+
* ちょっとお試しで使うならコレ
|
249
|
+
* コマンドラインで使うだけ
|
250
|
+
* いろいろ指定すればサーバーとしても利用可
|
251
|
+
|
252
|
+
= (('tag:x-small'))どれをインストールしたらいい?(2)
|
253
|
+
|
254
|
+
* groonga-server-http
|
255
|
+
* サーバー立てるならコレ
|
256
|
+
* groonga-server-gqtp
|
257
|
+
* 特に理由がなければスルー
|
258
|
+
|
259
|
+
= (('tag:x-small'))どれをインストールしたらいい?(3)
|
260
|
+
|
261
|
+
* groonga-httpd
|
262
|
+
* 不満がでてきたらコレ
|
263
|
+
* POSTしたいならコレ一択
|
264
|
+
|
265
|
+
= (('tag:x-small'))どれをインストールしたらいい?(3)
|
266
|
+
|
267
|
+
* ((*groonga-httpd*))
|
268
|
+
* 不満がでてきたらコレ
|
269
|
+
* POSTしたいならコレ一択
|
270
|
+
|
271
|
+
= Install Groonga(1)
|
272
|
+
|
273
|
+
(('⏳'))(('tag:x-small'))Groongaをインストールしてみましょう
|
274
|
+
|
275
|
+
* groonga-httpd
|
276
|
+
|
277
|
+
http://groonga.org/ja/docs/install.html
|
278
|
+
|
279
|
+
= Install Groonga(2)
|
280
|
+
|
281
|
+
(('⏳'))(('tag:x-small'))トークナイザーやノーマライザーをインストールしてみましょう
|
282
|
+
|
283
|
+
* groonga-tokenizer-mecab
|
284
|
+
* groonga-normalizer-mysql
|
285
|
+
|
286
|
+
http://groonga.org/ja/docs/install.html
|
287
|
+
|
288
|
+
= Install Groonga(3)
|
289
|
+
|
290
|
+
(('⏳'))(('tag:x-small'))Groongaが起動しているか確認しましょう
|
291
|
+
|
292
|
+
% curl http://localhost:10041/d/status
|
293
|
+
|
294
|
+
= Install Groonga(4)
|
295
|
+
|
296
|
+
(('⏳'))(('tag:x-small'))Groongaが起動していない場合は起動しましょう
|
297
|
+
|
298
|
+
% sudo service groonga-httpd start
|
299
|
+
|
300
|
+
= Install Mroonga(1)
|
301
|
+
|
302
|
+
(('⏳'))(('tag:x-small'))Mroongaをインストールしてみましょう
|
303
|
+
|
304
|
+
http://mroonga.org/ja/docs/install.html
|
305
|
+
|
306
|
+
= Install Mroonga(2)
|
307
|
+
|
308
|
+
(('⏳'))(('tag:x-small'))Mroongaが使えるか確認しましょう
|
309
|
+
|
310
|
+
mysql> show engines;
|
311
|
+
|
312
|
+
= Install Mroonga(3)
|
313
|
+
|
314
|
+
(('⏳'))(('tag:x-small'))インストールされているとどうなる?
|
315
|
+
|
316
|
+
mysql> SELECT * FROM mysql.plugin;
|
317
|
+
+---------+---------------+
|
318
|
+
| name | dl |
|
319
|
+
+---------+---------------+
|
320
|
+
| mroonga | ha_mroonga.so |
|
321
|
+
+---------+---------------+
|
322
|
+
1 row in set (0.00 sec)
|
323
|
+
|
324
|
+
= Install Mroonga(4)
|
325
|
+
|
326
|
+
(('⏳'))(('tag:x-small'))インストールされているとどうなる?
|
327
|
+
|
328
|
+
mysql> SELECT * FROM mysql.func;
|
329
|
+
+--------------------+-----+---------------+----------+
|
330
|
+
| name | ret | dl | type |
|
331
|
+
+--------------------+-----+---------------+----------+
|
332
|
+
| last_insert_grn_id | 2 | ha_mroonga.so | function |
|
333
|
+
| mroonga_snippet | 0 | ha_mroonga.so | function |
|
334
|
+
| mroonga_command | 0 | ha_mroonga.so | function |
|
335
|
+
| mroonga_escape | 0 | ha_mroonga.so | function |
|
336
|
+
+--------------------+-----+---------------+----------+
|
337
|
+
4 rows in set (0.00 sec)
|
338
|
+
|
339
|
+
= 今回の演習の題材
|
340
|
+
|
341
|
+
* 駅データ.jp
|
342
|
+
* http://www.ekidata.jp/
|
343
|
+
#* Wikipediaの記事の一部
|
344
|
+
# * (('tag:x-small'))http://ja.wikipedia.org/wiki/Wikipedia:データベースダウンロード
|
345
|
+
|
346
|
+
= 題材のダウンロード
|
347
|
+
|
348
|
+
(('⏳'))(('tag:x-small'))以下から今回使うサンプルをダウンロードしてください
|
349
|
+
|
350
|
+
http://packages.groonga.org/tmp/groonga-meetup-20140429.tar.gz
|
351
|
+
|
352
|
+
= Groonga編
|
353
|
+
|
354
|
+
* よく使うgroongaコマンド
|
355
|
+
* table_create/table_remove
|
356
|
+
* column_create/column_remove
|
357
|
+
* select/load/delete/dump
|
358
|
+
|
359
|
+
= テーブルのキーの話
|
360
|
+
|
361
|
+
* いろいろあるけど((*TABLE_PAT_KEY*))
|
362
|
+
* 長過ぎるキーは禁物(ShortText)
|
363
|
+
|
364
|
+
table_create Company TABLE_PAT_KEY UInt32
|
365
|
+
|
366
|
+
= データを追加/更新しよう
|
367
|
+
|
368
|
+
* 多才なloadコマンド
|
369
|
+
* 追加も更新もこれ一つで
|
370
|
+
|
371
|
+
= 失敗時にわかりやすいロードの仕方(1)
|
372
|
+
|
373
|
+
* こうやってロードできるけど
|
374
|
+
|
375
|
+
load --table Company
|
376
|
+
[
|
377
|
+
["_key", "column1", "column2", ...
|
378
|
+
["key1", "data1", "data2", ...
|
379
|
+
|
380
|
+
= 失敗時にわかりやすいロードの仕方(2)
|
381
|
+
|
382
|
+
* key:valueのペアがわかりやすい
|
383
|
+
|
384
|
+
load --table Company
|
385
|
+
[
|
386
|
+
{"_key": "key1", "column1":"data1", "column2":", ...
|
387
|
+
|
388
|
+
= 失敗時にわかりやすいロードの仕方(3)
|
389
|
+
|
390
|
+
(('⏳'))実際に試してみましょう
|
391
|
+
|
392
|
+
% 0001-load/load-fail.sh
|
393
|
+
% 0001-load/load-succeed.sh
|
394
|
+
|
395
|
+
[[0,1398668413.7959,0.00316190719604492],3]
|
396
|
+
|
397
|
+
= データをより安全にロードする(3)
|
398
|
+
|
399
|
+
(('⏳'))実際に試してみましょう\n
|
400
|
+
(('⚠'))((*_key:3のstatusが抜けている*))
|
401
|
+
|
402
|
+
% ./0001-load/load-fail.sh
|
403
|
+
% ./0001-load/load-succeed.sh
|
404
|
+
|
405
|
+
[[0,1398668413.7959,0.00316190719604492],3]
|
406
|
+
|
407
|
+
= データを更新してみよう
|
408
|
+
|
409
|
+
(('⏳'))実際に試してみましょう\n
|
410
|
+
((*_key:3のstatusを更新します*))
|
411
|
+
|
412
|
+
% ./0002-update/update-status.sh
|
413
|
+
|
414
|
+
= データを検索してみよう
|
415
|
+
|
416
|
+
(('⏳'))実際に試してみましょう\n
|
417
|
+
(('⚠'))((*1件もヒットしない*))
|
418
|
+
% ./0003-search/search-name.sh
|
419
|
+
|
420
|
+
= 検索するにはインデックスが必要(1)
|
421
|
+
|
422
|
+
(('⏳'))インデックスを追加してみましょう\n
|
423
|
+
|
424
|
+
% ./0003-search/add-index.sh
|
425
|
+
|
426
|
+
= 検索するにはインデックスが必要(2)
|
427
|
+
|
428
|
+
(('⏳'))COLUMN_INDEXを指定するのがポイントです
|
429
|
+
|
430
|
+
table_remove Lexicon
|
431
|
+
table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer \
|
432
|
+
TokenBigram --normalizer NormalizerAuto
|
433
|
+
column_create Lexicon name_index COLUMN_INDEX|WITH_SECTION|WITH_POSITION Users name
|
434
|
+
column_create Lexicon sect_index COLUMN_INDEX|WITH_SECTION|WITH_POSITION Users sect
|
435
|
+
|
436
|
+
= 検索するにはインデックスが必要(3)
|
437
|
+
|
438
|
+
(('⏳'))再度検索してみましょう\n
|
439
|
+
|
440
|
+
% ./0003-search/search-name.sh
|
441
|
+
|
442
|
+
= 検索するにはインデックスが必要(4)
|
443
|
+
|
444
|
+
(('⏳'))インデックスを覗いてみる
|
445
|
+
|
446
|
+
% ./0003-search/dump-lexicon.sh
|
447
|
+
|
448
|
+
= データを削除してみよう(1)
|
449
|
+
|
450
|
+
(('⏳'))キーをもとに削除する
|
451
|
+
|
452
|
+
delete Company 2
|
453
|
+
|
454
|
+
% 0004-delete/delete-by-key.sh
|
455
|
+
|
456
|
+
= データを削除してみよう(2)
|
457
|
+
|
458
|
+
(('⏳'))nameカラムの値をもとに削除する
|
459
|
+
|
460
|
+
delete Company --filter "name == 'JR北海道'"
|
461
|
+
|
462
|
+
% 0004-delete/delete-by-name.sh
|
463
|
+
|
464
|
+
= データを削除してみよう(3)
|
465
|
+
|
466
|
+
(('⏳'))statusの値をもとに削除する
|
467
|
+
|
468
|
+
delete Company --filter 'status > 0'
|
469
|
+
|
470
|
+
% 0004-delete/delete-by-status.sh
|
471
|
+
|
472
|
+
= HTTP経由でのリクエストの基本
|
473
|
+
|
474
|
+
* コマンド名 + キー=値のペア
|
475
|
+
|
476
|
+
http://localhost:10041/d/コマンド名?キー1=値1&キー2=値2....
|
477
|
+
|
478
|
+
= HTTP経由でテーブルを作成する(1)
|
479
|
+
|
480
|
+
(('⏳'))table_createコマンドを使ってアクセス
|
481
|
+
|
482
|
+
% ./0005-create-table/create-table.sh
|
483
|
+
|
484
|
+
curl 'http://localhost:10041/d/table_create?name=Company&type=TABLE_PAT_KEY&key_type=UInt32'
|
485
|
+
|
486
|
+
= HTTP経由でカラムを作成する(1)
|
487
|
+
|
488
|
+
(('⏳'))column_createコマンドを使ってアクセス
|
489
|
+
|
490
|
+
% ./0006-create-column/create-column.sh
|
491
|
+
|
492
|
+
curl 'http://localhost:10041/d/column_create?table=Company&name=full_name&flags=COLUMN_SCALAR&type=ShortText'
|
493
|
+
|
494
|
+
= POSTでデータを更新する(1)
|
495
|
+
|
496
|
+
(('⏳'))POSTでデータをロードしてみましょう
|
497
|
+
|
498
|
+
% ./0007-post-data/post-data.sh
|
499
|
+
|
500
|
+
= HTTPでデータを検索する(1)
|
501
|
+
|
502
|
+
(('⏳'))HTTP経由で検索してみましょう
|
503
|
+
|
504
|
+
% ./0008-search-http/search-http.sh
|
505
|
+
|
506
|
+
= 管理画面を触ってみよう
|
507
|
+
|
508
|
+
(('⏳'))ブラウザで次のURLにアクセスしてください
|
509
|
+
|
510
|
+
http://localhost:10041/
|
511
|
+
|
512
|
+
#= 位置情報を検索してみよう
|
513
|
+
#
|
514
|
+
#= 文字列をトークナイズしてみよう
|
515
|
+
#
|
516
|
+
#= 文字列を正規化してみよう
|
517
|
+
#
|
518
|
+
#= クエリ展開してみよう
|
519
|
+
#
|
520
|
+
#= 他のプロダクトを活用してみよう
|
521
|
+
#
|
522
|
+
#* Rroonga
|
523
|
+
#* Sewell
|
524
|
+
#* grnmini
|
525
|
+
#
|
526
|
+
#= Rroongaを使ってみる(1)
|
527
|
+
#
|
528
|
+
# Debian系% sudo apt-get install libgroonga-dev
|
529
|
+
# Red Hat系% sudo apt-get install groonga-devel
|
530
|
+
#
|
531
|
+
# % gem install rroonga
|
532
|
+
#
|
533
|
+
#= Sewellを使ってみる(1)
|
534
|
+
#
|
535
|
+
# % gem install sewell
|
536
|
+
#
|
537
|
+
#= Sewellを使ってみる(2)
|
538
|
+
#
|
539
|
+
# % gem install sewell
|
540
|
+
#
|
541
|
+
#= GrnMiniを使ってみる(1)
|
542
|
+
#
|
543
|
+
#* ongaeshiさん作
|
544
|
+
#
|
545
|
+
#= GrnMiniを使ってみる(2)
|
546
|
+
#
|
547
|
+
# % gem install grnmini
|
548
|
+
#
|
549
|
+
|
550
|
+
= Mroonga編
|
551
|
+
|
552
|
+
= モードの違いをおさえる(1)
|
553
|
+
|
554
|
+
* ラッパーモード
|
555
|
+
* データは他のストレージエンジン
|
556
|
+
* 全文検索をMroongaでがんばる
|
557
|
+
* トランザクションでロールバックすると不整合発生
|
558
|
+
* チューニングはMySQLの範囲で
|
559
|
+
|
560
|
+
= モードの違いをおさえる(2)
|
561
|
+
|
562
|
+
* ストレージモード
|
563
|
+
* 全部Mroongaでがんばる
|
564
|
+
* トランザクション何それ?
|
565
|
+
|
566
|
+
= ストレージモード
|
567
|
+
|
568
|
+
* ENGINE=mroongaと覚えましょう
|
569
|
+
|
570
|
+
= ラッパーモード
|
571
|
+
|
572
|
+
* コメントでエンジンを指定
|
573
|
+
|
574
|
+
ENGINE=mroonga COMMENT='engine "innodb"'
|
575
|
+
|
576
|
+
= パーサーの指定
|
577
|
+
|
578
|
+
* コメントでパーサーを指定
|
579
|
+
* Groongaの用語だとトークナイザー
|
580
|
+
|
581
|
+
FULLTEXT INDEX (content) COMMENT 'parser "TokenMecab"'
|
582
|
+
|
583
|
+
= ノーマライザーの指定
|
584
|
+
|
585
|
+
* コメントでノーマライザーを指定
|
586
|
+
|
587
|
+
FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto"'
|
588
|
+
|
589
|
+
= パーサー&ノーマライザーの指定
|
590
|
+
|
591
|
+
* 両方指定したいときは,で区切る
|
592
|
+
|
593
|
+
FULLTEXT INDEX (content) COMMENT 'parser "TokenMecab", normalizer "NormalizerAuto"'
|
594
|
+
|
595
|
+
= MATCH AGAINSTとBOOLEAN MODE
|
596
|
+
|
597
|
+
* QUERY EXPANSION MODE
|
598
|
+
* MySQLにおまかせの類似文書検索
|
599
|
+
* BOOLEAN MODE
|
600
|
+
* 明示的に検索を制御
|
601
|
+
|
602
|
+
= 位置情報検索
|
603
|
+
|
604
|
+
(('⏳'))(('tag:x-small'))Qiitaの位置情報検索の記事を試してみよう
|
605
|
+
|
606
|
+
http://qiita.com/groonga/items/7abca5004d2ae386d388
|
607
|
+
|
608
|
+
= 感謝
|
609
|
+
|
610
|
+
* WEICさん\n会場提供ありがとうございます!
|
611
|
+
|
612
|
+
= おわり
|
613
|
+
|
614
|
+
* Any Questions?
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rabbit-slide-kenhys-groonga-meetup-20140429
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2014.04.29.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- HAYASHI Kentaro
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-05-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rabbit
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.2
|
27
|
+
description: |-
|
28
|
+
2014年4月29日に行われたGroonga meetupで使用したスライドです。
|
29
|
+
GroongaやMroongaを初めて触れる人向けに演習を通じて基本をおさえてもらうための資料です。
|
30
|
+
今回は主にGroonga中心のサンプルを用意しました。
|
31
|
+
email:
|
32
|
+
- hayashi@clear-code.com
|
33
|
+
executables: []
|
34
|
+
extensions: []
|
35
|
+
extra_rdoc_files: []
|
36
|
+
files:
|
37
|
+
- .rabbit
|
38
|
+
- README.rd
|
39
|
+
- Rakefile
|
40
|
+
- config.yaml
|
41
|
+
- groonga-meetup-20140429.rab
|
42
|
+
- images/bohdi-select-menu.png
|
43
|
+
- images/bohdi-what-is-karma.png
|
44
|
+
- images/bohdi-works-for-me.png
|
45
|
+
- pdf/groonga-meetup-20140429-groonga-meetup-20140429.pdf
|
46
|
+
homepage: http://slide.rabbit-shocker.org/authors/kenhys/groonga-meetup-20140429/
|
47
|
+
licenses: []
|
48
|
+
metadata: {}
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options: []
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
requirements: []
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 2.2.2
|
66
|
+
signing_key:
|
67
|
+
specification_version: 4
|
68
|
+
summary: Groonga Meetup 2014/04/29
|
69
|
+
test_files: []
|