ClaudeCloudflare 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.

claudeenmodel: claude-haiku-4-5

AI Search now has hybrid search and relevance boosting

Key Points

  • Hybrid search combines vector and keyword search with configurable fusion
  • Relevance boosting prioritizes results by document metadata fields
  • Full control over tokenizers, match modes, and ranking strategies

Summary

Cloudflare AI Search now supports hybrid search combining vector and keyword search, plus relevance boosting to control result ranking based on document metadata.

Key Points

  • Hybrid Search: Combines vector (semantic) search with BM25 keyword search in parallel queries, fusing results into a single ranked list
  • Configurable Tokenizers: Choose between porter for natural language or trigram for code indexing
  • Match Modes: Configure keyword matching with and for precision or or for recall
  • Fusion Methods: Select rrf (reciprocal rank fusion) or max fusion strategy per instance
  • Relevance Boosting: Nudge rankings using up to 3 metadata fields (e.g., timestamp, priority) per instance or per request
  • Per-Request Overrides: Boost configuration can be customized at query time without changing instance settings

Configuration

Both features are configurable via TypeScript API with instance-level defaults and request-level overrides supported.

Full Translation

Translations

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

claudejamodel: claude-haiku-4-5

AI Search - AI Searchがハイブリッド検索と関連性ブーストに対応

AI Searchがハイブリッド検索と関連性ブーストに対応

2026年4月16日

AI Searchはハイブリッド検索と関連性ブーストに対応しました。これにより、結果の検索方法とランク付け方法をより細かく制御できるようになります。

ハイブリッド検索

ハイブリッド検索は、ベクトル(セマンティック)検索とBM25キーワード検索を単一のクエリで組み合わせます。

  • ベクトル検索: 正確な単語が異なる場合でも、意味が似たチャンクを検出します
  • キーワード検索: クエリ用語を正確に含むチャンクにマッチします

ハイブリッド検索を有効にすると、両方が並行して実行され、結果が単一のランク付けリストに統合されます。

インスタンスごとにトークナイザー(自然言語用のporter、コード用のtrigram)、キーワードマッチモード(精度重視のand、再現率重視のor)、融合方法(rrfまたはmax)を設定できます:

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つのブーストフィールドを設定するか、リクエストごとにオーバーライドできます:

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」の設定詳細を参照してください。