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
Drupal Elasticsearch Connector の日本語検索の質を高める
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Koji Kawamura
October 06, 2021
Technology
320
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Drupal Elasticsearch Connector の日本語検索の質を高める
2021-10-06 に Acquia でぶちゃんねるで発表した資料です。
Koji Kawamura
October 06, 2021
More Decks by Koji Kawamura
See All by Koji Kawamura
ESRE とか ELSER とか RRF ってナニ!? もろもろ理解してスッキリしよう
ijokarumawak
2
2.6k
Other Decks in Technology
See All in Technology
なぜ東京にいる私が、新潟の技術コミュニティを運営するのか by 八雲慎之助
yakumo
0
220
In-Context Learning再入門。ICLの勾配降下的解釈の研究動向を追ってみる。
dai08srhg
1
220
コードレビューをなくして見えたもの
henteko
0
130
サボる子はいねぇがー!AgentCoreハーネスの脆弱性に学ぶ、エージェントの入力バリデーション
iwamot
PRO
3
140
Lint の層を組み直した話
bengo4com
3
310
re:Invent2026 事前勉強会 歴史と愉しみ方10分LT編
toshi_atsumi
0
120
2拠点SRE活動始めてみた | sogaoh's LT @ ホンマでっかSRE勉強会 #3
sogaoh
PRO
0
240
200人の配信コメント、 全部Jevが仕分けます 〜 マサカリガードを作ってみた 〜
katayamatg
1
530
公共システムAdventCalendar2026
toru_kubota
0
150
20261016_Nagoya Tech Talk #4 データ活用のリアル AIも人も間違える
bessaralink55
0
160
re:Invent の去年のスケジュールを公開します!
miu_crescent
PRO
0
280
PostgreSQL オプティマイザ統計の秘密
nori_shinoda
0
310
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3.1k
Paper Plane
katiecoart
PRO
5
54k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
A designer walks into a library…
pauljervisheath
211
25k
Color Theory Basics | Prateek | Gurzu
gurzu
1
510
Art, The Web, and Tiny UX
lynnandtonic
304
22k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
780
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
450
The Curse of the Amulet
leimatthew05
3
16k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
Transcript
Drupal Elasticsearch Connector の 日本語検索の質を高める Koji Kawamura, Education Architect Oct
6, 2021
適切に権限を絞ったユーザを利用する "elastic" はスーパーユーザ! Elasticsearch drupal_* その他 drupal-connector
Elasticsearch に ロールを作成 クラスタ稼働状況の monitor 権限と 特定インデックスの操作の み許可
Elasticsearch に ユーザを作成 先程作成したロールを付与 したユーザを作成 パスワードに # があると Drupal から接続時にエ
ラーになるので注意 (内部で parse_url 関数を 利用しているため)
Drupal から Elasticsearch へ セキュアに接続 Elasticsearch 側のセキュ リティ設定をするのは大前 提。 Connector
の設定画面で 設定したパスワードはその まま閲覧できてしまう 最低限の権限でアクセス
インデックス名 インデックス名のプリフィッ クスをつけておくと他のイン デックスと差別化しやすい
Elasticsearch で全文検索 転置インデックスを作っている Elasticsearch drupal_* drupal-connector pages https://www.book-editing.com/why-book-indexing/ 本の末尾にある索引のような、転置インデックス
POST _analyze { "analyzer": "standard", "text": ["可愛いしいたけを試してみてください。"] } 検索漏れは少ないが、ノイズが大量発生。 「たけのこ」でもヒットするでしょう。
デフォルトの日本語解析
POST _analyze { "analyzer": "kuromoji", "text": ["可愛いしいたけを試してみてください。"] } 「しいたけ」で検索した場合のみヒットできる。 ノイズが減る。
Kuromoji は Elasticsearch のプラグイン。 形態素解析 kuromoji
Elasticsearch インデックスのカスタマイズ Drupal 側で作成する前に、事前に作成しておく Elasticsearch drupal_* drupal-connector pages Drupal 側から連携する前
に明示的に作成 1 2
インデックスを事前作成 PUT drupal_allcontents { "mappings": { "properties": { "_language": {
"type": "keyword" }, "body": { "type": "text", "analyzer": "kuromoji" } }, "id": { "type": "keyword" } } } 事前に作成しておけば、 Drupal の設定画面から指 定できない設定も行える
kuromoji でノイズを 減らすことができた! 可愛いしいたけを試してみてください。 でも、 ヒットしない
kuromoji_readingform で 読み仮名検索 可愛いしいたけを試してみてください。 doc #1 語 ドキュメント ID シイタケ
1 本文も検索語もカタカナで 解析してあげる
記事の本文を複数の方法でインデックス body を body と body_kana の二つの方法で索引付け
ユーザ辞書 kuromoji では辞書を使っ て単語の分割をしている 辞書に載っていない単語、 新語は検索もれが発生し てしまう そこでユーザ辞書! kuromoji_ dictionari
es.zip vi dictionaries/userdict_ja.txt 平茸,平茸,ヒラタケ,カスタム名詞 zip -r kuromoji_dictionaries.zip dictionaries
同義語 (シノニム) 同じものだけど 別の呼び方 ミルク、牛乳
おまけ Connector が発行するクエリってどんなの? Slow query でログ出力して観察
Elastic App Search という選択肢も クエリログの分析 ユーザが検索したキーワードで検索結果がヒッ トしない、もしくはクリックされない場合、検索エ ンジンとして改善が必要 関連度チューニング 複数の検索語を入力する際、全て含む
AND いずれか OR 3つ以上の場合少なくとも 1つ、 曖昧検索する?などを一つのスライダで制御可 能 クローラ Web サイトの自動巡回クローラがついに GA! より簡単にサイト内検索を提供可能に https://www.elastic.co/jp/app-search/
Elastic 公式トレーニングの紹介 体系的に学びたい方は是非 どんなコース?受講方法は? Elastic 公式トレーニングサービスのご紹介 https://www.elastic.co/jp/webinars/intro-to-elastic-training 定期開催 Elastic 公式トレーニングスケジュール
https://www.elastic.co/jp/training/schedule?timezone=Asia+-+Tokyo
Q&A Thank you!