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
Query Rulesの現在地
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kazuma Arimura
February 28, 2024
Technology
220
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
770
Shard Balancingについて理解したい/Understanding shard rebalancing in Elasticsearch
pakio
0
1.2k
Rallyで支えるバージョン追従
pakio
0
1.3k
CUEを使ったJSONテンプレート管理
pakio
0
1k
宣言的かつ安全に管理するElasticsearch/Declarative management for Elasticsearch
pakio
0
1.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
570
リプレイスを通して実現した、 より高度なサービス改善 / Service improvement process through the system replacement
pakio
0
5.6k
Other Decks in Technology
See All in Technology
OpenTelemetry eBPF Instrumentationの舞台裏 / Behind the Scenes of OpenTelemetry eBPF Instrumentation
ymotongpoo
4
1.3k
あるけみー式LTスライド作成術
alchemy1115
1
210
DEFCON_CHV_CTF_Write-up.pdf
bata_24
0
150
AI時代、データエンジニアが一番おもろい
genshun9
0
580
映像変換サーバーなしで端末内でHLSを生成してライブ配信
hikarusato
0
110
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
5
25k
Claude Codeを「使うほど育つ」AI秘書にするノウハウ
minorun365
PRO
27
20k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
3
500
生成AIエージェントを用いた、 手動テスト手順書から自動テストへの 変換手法の検討
magicpod
0
160
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
740
【技術的負債conf】事業成長に伴う技術的負債の説明責任とAIによるモニタリング、認知的負債について
i35_267
2
1.6k
Deployment の 先にある AI Agent 基盤 - kagent vNext、Agent Substrate、Hermes から読み解く Agent Runtime の現在地 / k8s-matsuri-2-ai-agent-platform-amsy810
masayaaoyama
3
550
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
The Curious Case for Waylosing
cassininazir
1
510
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
Navigating Team Friction
lara
192
16k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
The SEO Collaboration Effect
kristinabergwall1
1
560
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
480
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Building the Perfect Custom Keyboard
takai
2
870
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
280
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
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!