OpenAICloudflare Developer PlatformApr 16, 2026, 12:00 PM

AI Search - AI Search now has hybrid search and relevance boosting

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

AI Search - AI Search now has hybrid search and relevance boosting

Key Points

  • Hybrid combines semantic vectors + BM25
  • Configure tokenizer, match mode, and fusion
  • Boost ranking with up to 3 metadata fields

Summary

AI Search adds hybrid search (vector + BM25 keyword) and relevance boosting. Hybrid search runs semantic vector and BM25 keyword retrieval in parallel and fuses results; relevance boosting lets you nudge ranks using document metadata (e.g., timestamp, priority). Both are configurable per instance and can be overridden per request.

Key Points

  • Hybrid search
    • Runs vector and BM25 keyword retrieval in a single query and fuses results into one ranked list.
    • Configure per instance with index_method: { vector: true, keyword: true } and choose fusion_method (rrf or max).
    • Tokenizer choices: porter for natural language, trigram for code. Set keyword_match_mode to and (precision) or or (recall).
  • Relevance boosting
    • Boost rankings using up to 3 metadata fields (set per instance or per request via boost_by).
    • Typical uses: boost recent content (timestamp) or high-priority content (priority); specify direction (e.g., desc).
  • Practical notes
    • Prefer porter for docs and trigram for code indexes; use per-request boost overrides for special queries.
    • See the Search modes and Relevance boosting docs for configuration details and examples.

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

AI Search — ハイブリッド検索と関連性ブースティングが利用可能に

AI Search にハイブリッド検索と関連性ブースティングが追加されました

AI Search はハイブリッド検索と関連性ブースティングをサポートし、検索結果の検出とランキングをより細かく制御できるようになりました。

ハイブリッド検索

ハイブリッド検索は、ベクトル(セマンティック)検索と BM25 キーワード検索を 1 回のクエリで組み合わせます。ベクトル検索は語彙が異なっていても意味的に類似したチャンクを見つけ、キーワード検索はクエリ語を正確に含むチャンクと一致します。ハイブリッド検索を有効にすると、両方が並列で実行され、結果が融合されて単一のランク付きリストになります。

設定可能な項目:

  • トークナイザー(自然言語向けは "porter"、コード向けは "trigram")
  • キーワード一致モード(精度を優先する場合は "and"、網羅性を優先する場合は "or")
  • 融合方法("rrf" または "max")

これらはインスタンスごとに設定できます。例(TypeScript):

const instance = await env . AI_SEARCH . create ( { id : "my-instance" , index_method : { vector : true , keyword : true }, fusion_method : "rrf" , indexing_options : { keyword_tokenizer : "porter" }, retrieval_options : { keyword_match_mode : "and" }, } ) ;

参照: Search modes(概要)および Hybrid search(構成の詳細)。

関連性ブースティング

関連性ブースティングでは、ドキュメントのメタデータに基づいて検索ランキングを調整できます。たとえば、"timestamp" で最近のドキュメントを優先したり、"priority" のようなカスタムメタデータで重要なコンテンツを上位に表示できます。インスタンスごとに最大 3 つのブーストフィールドを設定するか、リクエスト単位で上書きできます。

例(TypeScript):

const results = await env . AI_SEARCH . get ( "my-instance" ) . search ( { messages : [ { role : "user" , content : "deployment guide" } ] , ai_search_options : { retrieval : { boost_by : [ { field : "timestamp" , direction : "desc" }, { field : "priority" , direction : "desc" }, ] , }, }, } ) ;

参照: Relevance boosting(構成の詳細)。