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
Elasticsearch2系
Search
tsuyoshi nakamura
August 31, 2016
Technology
93
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Elasticsearch2系
Elasticsearch2系で日本語検索を試す
tsuyoshi nakamura
August 31, 2016
More Decks by tsuyoshi nakamura
See All by tsuyoshi nakamura
社内の勉強会で発表した_output_一部抜粋版_.pdf
tsuyoshi
0
510
PHPを少しでも早く_条件はあるよ_.pdf
tsuyoshi
0
88
スタートアップ6年目のレビュー文化.pdf
tsuyoshi
1
2k
PHPを少し深堀るよ.pdf
tsuyoshi
0
410
Reactive_Manifesto.pdf
tsuyoshi
0
94
About_Resilience.pdf
tsuyoshi
1
100
エンジニアの循環ってgood_or_bad_.pdf
tsuyoshi
0
1.3k
スタートアップしてからの失敗の数々
tsuyoshi
0
2.5k
スタートアップエンジニアの役割
tsuyoshi
0
560
Other Decks in Technology
See All in Technology
ASTを使って影響範囲を特定する
nealle
0
170
2026-09-11 【Snowflake World Tour Tokyo 2026】Snowflakeを起点に、AI Agentが自律稼働し続ける未来へ / Driving AI Agents with Snowflake
civitaspo
0
330
作り直せるコードは迅速に 作り直せないDBは慎重に - AI時代のプロダクトエンジニアが「判断の不可逆性」で開発速度を変える話
kinosuke01
0
320
#jawssonic2026 あの時代が悪かった ~動かなかったSageMakerと共に迎えたイベント当日~
ktkn1129
0
150
From Vanilla Kubernetes to a Batteries-Included Platform: Developer Experience at 1,300+ Clusters
yosshi_
0
680
アプリをもっと"iOSアプリっぽく"する小さな工夫 / Small Touches That Make Your App Feel More Like an iOS App
matsuji
1
610
Screen Lens - 今見てる画面を翻訳する
komagata
0
250
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
140
生成AIのテナント制御とシャドーMCP対策 | AIを"止めずに"、情報を守る
yukun
0
160
Adaptive Warehouse を今すぐ導入すべき理由と迷ったときの判断基準
__allllllllez__
0
190
GoCon2026 - Open Source, Open World
sanposhiho
4
3.3k
synctest時代のhttptest Go 1.27で変わるHTTPサーバテストの裏側 / go conference2026 synctest and httptest
budougumi0617
1
2.7k
Featured
See All Featured
Designing Experiences People Love
moore
143
24k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
590
Amusing Abliteration
ianozsvald
1
290
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
410
Bash Introduction
62gerente
615
220k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
440
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Unsuck your backbone
ammeep
672
58k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Google's AI Overviews - The New Search
badams
0
1.6k
The Spectacular Lies of Maps
axbom
PRO
1
990
Transcript
࣮ફElasticsearch(2.1.1) 2016-01-22 ࣾษڧձ Tsuyoshi Nakamura
全文検索エンジンとしては色々な歴史をたどってきました͕ɺࠓશจݕࡧΤϯδ ϯͱ͍͑”Elas'csearch”͕ྑ͍Έ͍ͨͳײ͡ͰɺAWSʹొ
Agenda • Install͔Βconfigઃఆ • Kuromoji • AnalysisϞδϡʔϧ • ओཁϞδϡʔϧ •
Demo • ௐࠪΓ͠
Install ʙ config • JavayumͰinstall • Elasticsearchެࣜͷrepositories͔ΒkeyΛinport. • Yumઃఆͯ͠yum installͰ࠷৽(2.1.1)͕ೖΔ
• ຊޠͷશจݕࡧʹඞཁͳpluginΛinstall Kuromoji plugin install bin/plugin install analysis-kuromoji ※https://www.elastic.co/guide/en/elasticsearch/plugins/master/analysis- kuromoji.html ※https://github.com/elastic/elasticsearch-analysis-kuromoji
Kuromoji • ͷ໊લʢΫϩϞδʁʣʁ༶ࢬͷࠇจࣈʁ • ͔Βͳ͍͚Ͳઈศར • Solr͍ͬͯͨ࣌͡ຊޠ༻ͷࣙॻʢMecabΒChasenΒʣΛࣗͰ ೖΕͯɺɺɺͱ৭ʑͱ໘͚ͩͬͨͨ
AnalysisϞδϡʔϧ Analyzer • ෳઃఆՄೳ • τʔΫφΠζॲཧʢܗଶૉղੳʣ • ϑΟϧλʔॲཧ IndexΛ࡞͢Δ࣌ɺݕࡧ͢Δ࣌͜Μͳॲཧ͕ߦΘΕΔ
AnalysisϞδϡʔϧ Tokenizer • τʔΫφΠζํࣜΛઃఆ • KuromojiΛͬͯτʔΫφΠζ͢Δͱ͔ • ngramࣜʹτʔΫφΠζ͢Δͱ͔ Token Filters
• τʔΫφΠζॲཧޙͷτʔΫϯʹରͯ͠ՃॲཧΛ͢Δ • શ֯ӳࣈΛ֯ʹ͠ɼ֯ΧλΧφΛશ֯ʹ͢ͱ͔ Char Filters • τʔΫφΠζॲཧલͷจࣈʹରͯ͠ՃॲཧΛ͢Δ • ه߸ͩͬͨΓɺʮʑʯͩͬͨΓΛআڈ͢Δ࣌ʹ͏
ओཁϞδϡʔϧ Ngram Tkenizer • N-άϥϜͰτʔΫφΠζɻElasticsearchʹ͋Δ cjk_width Token Filter • ֯શ֯Λ౷Ұ͢ΔϑΟϧλɻElasticsearchʹ͋Δ
Lowercase Token Filter • ӳࣈͷେจࣈখจࣈΛ౷Ұ͢ΔϑΟϧλɻElasticsearchʹ͋Δ Synonym Token Filter • ಉٛޠΛ݁ͼ͚ͭΔϑΟϧλɻElasticsearchʹ͋Δ Stop Token Filter • ҙͷϫʔυΛআڈ͢ΔϑΟϧλɻElasticsearchʹ͋Δ HTML Strip Char Filter • HTMLλάΛআڈ͢ΔϑΟϧλɻElasticsearchʹ͋Δ
ࠓճ࡞ͬͨconfig(elasticsearch.yml) # ---------------------------------- Index ----------------------------------- index : analysis : analyzer
: ja : type : custom tokenizer : ja_tokenizer char_filter : [ html_strip, kuromoji_iteration_mark ] filter : [ lowercase, cjk_width, katakana_stemmer, kuromoji_part_of_speech ] ja_ngram : type : custom tokenizer : ngram_ja_tokenizer char_filter : [html_strip] filter : [ cjk_width, lowercase ] tokenizer : ja_tokenizer : type : kuromoji_tokenizer mode : search user_dictionary : /etc/elasticsearch/userdict_ja.txt ngram_ja_tokenizer : type : nGram min_gram : 2 max_gram : 3 token_chars : [letter, digit] filter : katakana_stemmer : type : kuromoji_stemmer
ࠓճ࡞ͬͨindex mapping { "order": 0, "template": "projects01-*", "settings": { "index":
{ "number_of_shards": "1", "number_of_replicas": "0" } }, "mappings": { "project": { "_source": { "enabled": false }, "_all": { "analyzer": "ja", "enabled": true }, "properties": { "update_time": { "format": "YYYY-MM-dd HH:mm:ss", "type": "date" }, "project_id": { "index": "not_analyzed", "type": "string" }, "detail": { "analyzer": "ja", "type": "string" }, "suggest": { "search_analyzer": "ja", "analyzer": "ja", "type": "completion" }, "detail_ngram": { "analyzer": "ja_ngram", "type": "string" }, "title": { "analyzer": "ja", "type": "string" }, "title_ngram": { "analyzer": "ja_ngram", "type": "string" } } } }, "aliases": { }
Demo
Demo • Elasticsearchͷཧπʔϧ(kopf)ΛݟΔ • ͍Ζ͍Ζػೳ͋Δɻ • Mappingͱ͔͜͜Ͱొͨ͠ • ศརɺ͔͍͍ͬ͜ •
IndexΛ࡞ͬͯΈΔ • ݕࡧͯ͠ΈΔ • αδΣετػೳ(completion)͔ͭͬͯΈΔ
·ͩௐ͕ࠪඞཁͳՕॴ • Indexͷӡ༻ɺߋ৽ϑϩʔ • Pyhon curator • Score • ಉ͡ݕࡧͰݱࡏਐߦ͍ͯ͠ΔPJΛݕࡧ݁Ռͷ্ҐΈ͍ͨͳཁ݅
͕ग़͖ͯͦ͏ • SlowΫΤϦͱ͔ͷᮢ • ES_HEAP_SIZEɺεϫοϓ • clusterɺshardɺreplica • IndexͷόοΫΞοϓɺϦετΞ • Pyhonͷtoolɺ_snapshotɺόΠφϦόοΫΞοϓ • Facet? AggregationsͰ͍͚Δʁ