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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kazuma Arimura
February 28, 2024
Technology
230
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
Transcript
21 slides
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!
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
780
Shard Balancingについて理解したい/Understanding shard rebalancing in Elasticsearch
pakio
0
1.2k
Rallyで支えるバージョン追従
pakio
0
1.3k
CUEを使ったJSONテンプレート管理
pakio
0
1.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.4k
マッピング設定最適化によるパフォーマンス改善の取り組み + match_only_textのパフォーマンス検証 / Improving indexing performance by specifying mapping properties.
pakio
0
580
リプレイスを通して実現した、 より高度なサービス改善 / Service improvement process through the system replacement
pakio
0
5.7k
Other Decks in Technology
See All in Technology
AWS Emulator を評価する: 手元で動く AWS の API の仕組み、始め方、確かめ方
inariku
PRO
1
740
Go初心者のクラウドエンジニアが、デプロイを通して旨味を知っていく話
ryudai
1
230
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
17
120k
アラートを見直していたら営業組織への理解にちょっとだけ繋がった話
z63d
1
210
IoTのデータ保存をSREの観点で考える
grimoh
1
100
コピーオンライト型ファイルシステムと ランダム書き込み
sat
PRO
2
120
異夢同船〜異なる夢でも同じ船でなんとかする〜
fortegp05
1
470
業務の傍らで進める改善ループエンジニアリング
bengo4com
0
160
SSFの現在地 ― CAEP/RISCからAI Identityへ
oidfj
0
460
Quick Automate | 目指せ Quick マスター 12
inariku
PRO
1
120
プロダクションコードにおける encoding/json から encoding/json/v2 へのスムーズな移行
sansantech
PRO
1
440
【Oracle AI SPOTLIGHT ウェビナー】【特別開催:日本語で解説!】Oracle AI World 2026 最新情報フィードバック
oracle4engineer
PRO
1
260
Featured
See All Featured
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.7k
Darren the Foodie - Storyboard
khoart
PRO
5
4.1k
The agentic SEO stack - context over prompts
schlessera
0
1k
Speed Design
sergeychernyshev
33
2.2k
WENDY [Excerpt]
tessaabrams
15
41k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k
The Curious Case for Waylosing
cassininazir
1
610
The Cult of Friendly URLs
andyhume
79
7.1k
The SEO identity crisis: Don't let AI make you average
varn
0
630
Why Our Code Smells
bkeepers
PRO
340
58k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
830
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k