Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Query Rulesの現在地
Search
Kazuma Arimura
February 28, 2024
Technology
0
190
Query Rulesの現在地
第58回Elasticsearch勉強会 2024.2.28 #elasticsearchjp
Kazuma Arimura
February 28, 2024
Tweet
Share
More Decks by Kazuma Arimura
See All by Kazuma Arimura
言語モデルを用いたQuery Categorizationへの取り組み / LM-based query categorization for query understanding
pakio
0
1.1k
Search platform migration at MercariUS/Mercari USにおけるElasticsearchへの検索基盤移行:マイグレーションの知見と課題
pakio
0
670
Shard Balancingについて理解したい/Understanding shard rebalancing in Elasticsearch
pakio
0
1.1k
Rallyで支えるバージョン追従
pakio
0
1.2k
CUEを使ったJSONテンプレート管理
pakio
0
980
宣言的かつ安全に管理するElasticsearch/Declarative management for Elasticsearch
pakio
0
1k
8.0からのkNNはどう変わったのか / How kNN search changed in the Elasticsearch 8.0
pakio
1
2.2k
マッピング設定最適化によるパフォーマンス改善の取り組み + match_only_textのパフォーマンス検証 / Improving indexing performance by specifying mapping properties.
pakio
0
520
リプレイスを通して実現した、 より高度なサービス改善 / Service improvement process through the system replacement
pakio
0
5.3k
Other Decks in Technology
See All in Technology
文字列の並び順 / Unicode Collation
tmtms
3
580
評価駆動開発で不確実性を制御する - MLflow 3が支えるエージェント開発
databricksjapan
1
180
Lookerで実現するセキュアな外部データ提供
zozotech
PRO
0
100
今年のデータ・ML系アップデートと気になるアプデのご紹介
nayuts
1
380
Lessons from Migrating to OpenSearch: Shard Design, Log Ingestion, and UI Decisions
sansantech
PRO
1
130
Kubernetes Multi-tenancy: Principles and Practices for Large Scale Internal Platforms
hhiroshell
0
120
re:Invent 2025 ふりかえり 生成AI版
takaakikakei
1
210
Power of Kiro : あなたの㌔はパワステ搭載ですか?
r3_yamauchi
PRO
0
150
WordPress は終わったのか ~今のWordPress の制作手法ってなにがあんねん?~ / Is WordPress Over? How We Build with WordPress Today
tbshiki
1
770
Kiro Autonomous AgentとKiro Powers の紹介 / kiro-autonomous-agent-and-powers
tomoki10
0
480
Debugging Edge AI on Zephyr and Lessons Learned
iotengineer22
0
200
30分であなたをOmniのファンにしてみせます~分析画面のクリック操作をそのままコード化できるAI-ReadyなBIツール~
sagara
0
150
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Being A Developer After 40
akosma
91
590k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
How GitHub (no longer) Works
holman
316
140k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
A better future with KSS
kneath
240
18k
Designing for humans not robots
tammielis
254
26k
Practical Orchestrator
shlominoach
190
11k
Scaling GitHub
holman
464
140k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
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!