Package version:

Type Alias SearchResult<TModel, TFields>

SearchResult<TModel, TFields>: {
    captions?: QueryCaptionResult[];
    document: NarrowedModel<TModel, TFields>;
    documentDebugInfo?: DocumentDebugInfo;
    highlights?: {
        [k in SelectFields<TModel>]?: string[]
    };
    rerankerScore?: number;
    score: number;
}

Contains a document found by a search query, plus associated metadata.

Type Parameters

Type declaration

  • Optional Readonlycaptions?: QueryCaptionResult[]

    Captions are the most representative passages from the document relatively to the search query. They are often used as document summary. Captions are only returned for queries of type 'semantic'. NOTE: This property will not be serialized. It can only be populated by the server.

  • document: NarrowedModel<TModel, TFields>
  • Optional ReadonlydocumentDebugInfo?: DocumentDebugInfo

    Contains debugging information that can be used to further explore your search results. NOTE: This property will not be serialized. It can only be populated by the server.

  • Optional Readonlyhighlights?: {
        [k in SelectFields<TModel>]?: string[]
    }

    Text fragments from the document that indicate the matching search terms, organized by each applicable field; null if hit highlighting was not enabled for the query. NOTE: This property will not be serialized. It can only be populated by the server.

  • Optional ReadonlyrerankerScore?: number

    The relevance score computed by the semantic ranker for the top search results. Search results are sorted by the RerankerScore first and then by the Score. RerankerScore is only returned for queries of type 'semantic'. NOTE: This property will not be serialized. It can only be populated by the server.

  • Readonlyscore: number

    The relevance score of the document compared to other documents returned by the query. NOTE: This property will not be serialized. It can only be populated by the server.