Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
シラサギ勉強会 - Elasticsearch
Search
NAKANO Hideo
September 15, 2017
Programming
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
シラサギ勉強会 - Elasticsearch
全文検索とはなんぞやから入って、シラサギでのElasticsearchの応用例まで広く浅く解説。
NAKANO Hideo
September 15, 2017
More Decks by NAKANO Hideo
See All by NAKANO Hideo
自治体向けのCMS+グループウェア+ウェブメール=『シラサギ』のご紹介
sunny4381
0
580
Google AMPとPWAをさらっと紹介
sunny4381
0
240
Other Decks in Programming
See All in Programming
地方こそサーバーレス — 10年続けた、顔が見えるチームで確かな基盤を / Serverless Matters Most in Regional Areas — 10 Years of Building Reliable Foundations with Close-Knit Teams
seike460
PRO
1
320
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
200
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
220
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
2k
GraphQL の onError と Nullability のこれから
quramy
0
210
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
230
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
150
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
330
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
810
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
300
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
140
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
4
3.6k
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Skip the Path - Find Your Career Trail
mkilby
1
290
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
SEO for Brand Visibility & Recognition
aleyda
0
4.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Faster Mobile Websites
deanohume
310
32k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
350
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Transcript
http://www.web-tips.co.jp/ Copyright © 2014- Web Tips Co.,Ltd All Rights Reserved.
シラサギ勉強会 Elasticsearch 2017/9/15 株式会社ウェブチップス 中野 英雄
Elasticsearchとは? 2
3 全⽂検索サーバーとして知られていますが 全⽂検索サーバーって?
4 データベースの⼀つである NoSQL データベースに分類されるデータベース
ACID特性とCAP定理 5
6 詳しくは: http://masawan-guitar.hatenablog.com/entry/2016/08/14/163447
7 ElasticsearchはCP型のデータベース ただし、 https://discuss.elastic.co/t/elasticsearch-and-the-cap- theorem/15102/3によると、not fully Pでnot fully Aでnot fully
Cであ る
転地インデックス 通常のDBと全⽂検索を分かつもの 8
9 だいたいのDB(MongoDBを含む) B-Treeインデックス 全⽂検索 転地インデックス
10 http://gihyo.jp/dev/serial/01/search-engine/0003 ⽐較的以下のページの解説が分かりやすい
⾔語処理 全⽂検索を特徴づけるもの 11
揺れ • 英語 • 単複/3⼈称: man ⇔ men • 現在と過去:
run ⇔ ran • ⽇本語 • 半⾓と全⾓ • アラビア数字と漢数字 • 送り仮名: ⾒積もり ⇔ ⾒積り⇔ ⾒積 • フォルダーとフォルダ • 略語: ⾃販機 ⇔ ⾃動販売機 12
インデックス時の正規化 vs 検索時の展開 • インデックス時の正規化 • DB格納前に「正規語」に統⼀して格納する • アカデミックにいうなら、⾒出し語(lemma)といった⽅がいいけど… •
検索時の展開 • 検索時に可能な組み合わせでOR検索する • 例: 「⾒積もり OR ⾒積り OR ⾒積」で検索 • どちらがいいかはケース・バイ・ケース • 例: マツケン 13
フレーズ検索 • 形態素解析 • ⽇本語形態素解析により「東京」「特許」「許可局」に分割される。 • このため「特許」で検索した際、「東京特許許可局」を含む⽂書が ヒットする(再現率UP) • では「東京特許許可局」を検索すると?
14
フレーズ検索 15 東京 AND 特許 AND 許可局?
フレーズ検索 16 「東京」と「特許」が隣接し、「特 許」と「許可局」が隣接する⽂書に マッチする これを「フレーズ検索」と呼ぶ
フレーズ検索 • 隣接って? • 必ずしも隣り合っている必要があるかは、全⽂検索エンジンの設定に よる。 • 例えば「レディーガガ」で検索した場合に「レディー・ガガ」にマッ チするように、1つ⾶ばしぐらいなら隣接しているとみなす検索エンジ ンの⽅が多い。
17
Elasticsearch 18
公式情報 • 公式ページ • https://www.elastic.co/products/elasticsearch • Support Matrix • https://www.elastic.co/jp/support/matrix
• ※InstallationにはOracle JDK version 1.8.0_131の利⽤が推奨されている • Getting Started • https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html • GitHub • https://github.com/elastic/elasticsearch • License • Apache License 19
クラスタ構成 20 https://gist.github.com/yano3/3f5abc9eba0c1ad6a0508056961b273c
SHIRASAGIでのElasticsearch の設定 21
⽇本語設定 項⽬名 英語名 例 形態素解析 kuromoji ⽂字の正規化 icu_normalizer ㌀ →
アパート、アパート → アパート 踊り字の正規化 kuromoji_iteration_mark 時々 → 時時、こゝろ→こころ 活⽤形の正規化 kuromoji_baseform 飲み → 飲む ※連⽤形 → 終⽌形 助詞などの除去 kuromoji_part_of_speech 寿司がおいしいね → 「寿司」「おいしい」だ け残して、「が」と「ね」を削除 頻出語句で検索に 有⽤でない⾔葉を 除去 ja_stop これ、それ、あれ、しかし、私 漢数字の正規化 kuromoji_number ⼀〇〇〇(漢数字のゼロ)→ 1000 ⻑⾳の除去 kuromoji_stemmer プリンター → プリンタ 22 http://qiita.com/shin_hayata/items/41c07923dbf58f13eec4
添付ファイル • Ingest Attachment Plugin • https://www.elastic.co/guide/en/elasticsearch/plugins/master/ing est-attachment.html • 内部ではApache
Tikaを使ってテキストを抽出 23
24