SongGuess
    Preparing search index...

    Common shape for ai_search_options used by both single-instance and multi-instance requests. Contains retrieval, query rewrite, reranking, and cache sub-options.

    type AiSearchOptions = {
        cache?: {
            cache_threshold?:
                | "super_strict_match"
                | "close_enough"
                | "flexible_friend"
                | "anything_goes";
            enabled?: boolean;
        };
        query_rewrite?: {
            enabled?: boolean;
            model?: string;
            rewrite_prompt?: string;
            [key: string]: unknown;
        };
        reranking?: {
            enabled?: boolean;
            match_threshold?: number;
            model?: string;
            [key: string]: unknown;
        };
        retrieval?: {
            boost_by?: {
                direction?: "asc"
                | "desc"
                | "exists"
                | "not_exists";
                field: string;
            }[];
            context_expansion?: number;
            filters?: VectorizeVectorMetadataFilter;
            fusion_method?: "max"
            | "rrf";
            keyword_match_mode?: "and" | "or";
            match_threshold?: number;
            max_num_results?: number;
            metadata_only?: boolean;
            retrieval_type?: "vector" | "keyword" | "hybrid";
            return_on_failure?: boolean;
            [key: string]: unknown;
        };
        [key: string]: unknown;
    }

    Indexable

    • [key: string]: unknown
    Index

    Properties

    cache?: {
        cache_threshold?:
            | "super_strict_match"
            | "close_enough"
            | "flexible_friend"
            | "anything_goes";
        enabled?: boolean;
    }
    query_rewrite?: {
        enabled?: boolean;
        model?: string;
        rewrite_prompt?: string;
        [key: string]: unknown;
    }
    reranking?: {
        enabled?: boolean;
        match_threshold?: number;
        model?: string;
        [key: string]: unknown;
    }

    Type Declaration

    • [key: string]: unknown
    • Optionalenabled?: boolean
    • Optionalmatch_threshold?: number

      Match threshold (0-1, default 0.4)

    • Optionalmodel?: string
    retrieval?: {
        boost_by?: {
            direction?: "asc" | "desc" | "exists" | "not_exists";
            field: string;
        }[];
        context_expansion?: number;
        filters?: VectorizeVectorMetadataFilter;
        fusion_method?: "max"
        | "rrf";
        keyword_match_mode?: "and" | "or";
        match_threshold?: number;
        max_num_results?: number;
        metadata_only?: boolean;
        retrieval_type?: "vector" | "keyword" | "hybrid";
        return_on_failure?: boolean;
        [key: string]: unknown;
    }

    Type Declaration

    • [key: string]: unknown
    • Optionalboost_by?: { direction?: "asc" | "desc" | "exists" | "not_exists"; field: string }[]

      Boost results by metadata field values. Max 3 entries.

    • Optionalcontext_expansion?: number

      Number of surrounding chunks to include for context (0-3). Default 0.

    • Optionalfilters?: VectorizeVectorMetadataFilter

      Vectorize metadata filters applied to the search.

    • Optionalfusion_method?: "max" | "rrf"

      Fusion method for combining vector + keyword results.

    • Optionalkeyword_match_mode?: "and" | "or"

      How keyword terms are combined: "and" = all terms must match, "or" = any term matches.

    • Optionalmatch_threshold?: number

      Minimum similarity score (0-1) for a result to be included. Default 0.4.

    • Optionalmax_num_results?: number

      Maximum number of results to return (1-50). Default 10.

    • Optionalmetadata_only?: boolean

      If true, return only item metadata without chunk text.

    • Optionalretrieval_type?: "vector" | "keyword" | "hybrid"

      Which retrieval backend to use. Defaults to the instance's configured index_method.

    • Optionalreturn_on_failure?: boolean

      If true (default), return empty results on retrieval failure instead of throwing.