Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Query Rulesの現在地
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kazuma Arimura
February 28, 2024
Technology
200
0
Share
Query Rulesの現在地
第58回Elasticsearch勉強会 2024.2.28 #elasticsearchjp
Kazuma Arimura
February 28, 2024
More Decks by Kazuma Arimura
See All by Kazuma Arimura
言語モデルを用いたQuery Categorizationへの取り組み / LM-based query categorization for query understanding
pakio
0
1.2k
Search platform migration at MercariUS/Mercari USにおけるElasticsearchへの検索基盤移行:マイグレーションの知見と課題
pakio
0
720
Shard Balancingについて理解したい/Understanding shard rebalancing in Elasticsearch
pakio
0
1.1k
Rallyで支えるバージョン追従
pakio
0
1.2k
CUEを使ったJSONテンプレート管理
pakio
0
1k
宣言的かつ安全に管理するElasticsearch/Declarative management for Elasticsearch
pakio
0
1k
8.0からのkNNはどう変わったのか / How kNN search changed in the Elasticsearch 8.0
pakio
1
2.3k
マッピング設定最適化によるパフォーマンス改善の取り組み + match_only_textのパフォーマンス検証 / Improving indexing performance by specifying mapping properties.
pakio
0
550
リプレイスを通して実現した、 より高度なサービス改善 / Service improvement process through the system replacement
pakio
0
5.5k
Other Decks in Technology
See All in Technology
Swift Sequence の便利 API 再発見
treastrain
1
120
ブラウザの投機的読み込みと投機ルールAPIを理解し、Webサービスのパフォーマンスを最適化する
shuta13
3
290
雑談は、センサーだった
bitkey
PRO
2
210
OWASP APTSを眺めてみた
su3158
0
130
Forget technical debt
ufried
0
170
世界の中心でApp Runnerを叫ぶ FINAL
tsukuboshi
0
250
ServiceによるKubernetes通信制御ーClusterIPを例に
miku01
1
150
"うちにはまだ早い"は本当? ─ 小さく始めるPlatform Engineering入門
harukasakihara
1
220
Modernizing Your HCL Connections Experience: Visual Report to chain, Profile Enhancements, and AI Integration
wannesrams
0
290
Vision Banana: Image Generators are Generalist Vision Learners
kzykmyzw
0
310
Every Conversation Counts
kawaguti
PRO
0
130
Agent Skillsで実現する記憶領域の運用とその後
yamadashy
2
1.4k
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
528
40k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Heart Work Chapter 1 - Part 1
lfama
PRO
6
35k
Un-Boring Meetings
codingconduct
0
280
What's in a price? How to price your products and services
michaelherold
247
13k
Design in an AI World
tapps
1
210
The untapped power of vector embeddings
frankvandijk
2
1.7k
How to Think Like a Performance Engineer
csswizardry
28
2.6k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
430
GraphQLとの向き合い方2022年版
quramy
50
15k
Why Our Code Smells
bkeepers
PRO
340
58k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Transcript
Query Rulesの現在地 第58回Elasticsearch勉強会 2024.2.28 Kazuma Arimura (@pakio)
自己紹介 Kazuma Arimura • 株式会社メルカリ • Mercari US@Tokyo ML/Search
team • Software Engineer(Search)
Query Rules とは?
Query Rules とは? • 検索時に何らかの目的を持ってクエリを動的に書き換える機能、 及びその際に参照するルールセット
参考:他の検索エンジンでは? • Vespa ◦ Query Rewriting 機能 ▪ 検索クエリの書き換え無しで利用可能 (要設定)
▪ 検索キーワードをトリガーに発動 ▪ 特定フィールドへのBoosting, Rewrite, Stop wordsなどが利用可能 • Algolia ◦ Rules 機能 ▪ 検索クエリの書き換え無しで利用可能 (要設定) ▪ 検索クエリをトリガーに発動 ▪ 文書の固定, 文書の非表示, Stop words, Rewrite, Boostingなどが利用可能
Query Rules API
https://www.elastic.co/jp/blog/introducing-query-rules-elasticsearch-8-10
要約:Introducing query rules in Elasticsearch 8.10 • 検索結果を検索クエリへの関連度とは別の観点からカスタマイズする機能 • Elasticsearch
8.10 で導入 (Technical Preview) • 現在はPinned Queryの動的な挿入をサポート • 想定ユースケース例 ◦ ナレッジ検索 : お知らせページの固定 ◦ EC検索 : プロダクトのプロモーション
前提:Pinned Query とは? • Elasticsearch 7.4 で追加 • 検索クエリの関連度に関わらず、 指定された文書を優先して返却
前提:Pinned Query とは? 通常の検索クエリ
前提:Pinned Query とは? 固定対象の文書ID
前提:Pinned Query とは? スコアがかさ増しされ、優先的に返却
Query Rules の利用方法 引用元: https://www.elastic.co/jp/blog/introducing-query-rules-elasticsearch-8-10
Query Rules の利用方法 1. Query Rules の作成 2. Query Rules
の登録 3. 検索クエリの書き換え
1. Query Rules の作成 rule_id 管理用ID type ルールの種類 criteria 適用条件の詳細
type: - exact: 完全一致 - fuzzy: 一定編集距離内の場合一致 - prefix: 前方一致 - suffix: 後方一致 - contains: 含有 - lt, lte, gt, gte: 数値範囲 - always: 常時オン metadata: 検索時に指定 actions 固定ドキュメントの指定 (Max: 100)
2. Query Rules の登録 PUT /_query_rules API 経由で登録
3. 検索クエリの書き換え organic 内に検索条件を移動 + 適用対象の ruleset_id を指定
3. 検索クエリの書き換え match_criteria 内に ルール照会条件を指定 ※ ルール作成時のmetadataに該当
Query Rules 👍 • Relevancyを超えて最適化が可能 • API経由で管理 • 適用条件のカスタマイズ性 👎
• 機能がIDベースのPinned Queryに限定 • クエリの書き換えが必要
参考:Searchkit • Searchkit ◦ Query Rules 機能 ▪ 検索クエリの書き換え無しで利用可能 (要設定)
▪ 検索キーワードをトリガーに発動 ▪ 特定フィールドへのBoosting, Rewrite, Stop wordsなどが利用可能
Thanks!