Package version:

Interface SemanticSearchOptions

Defines options for semantic search queries

interface SemanticSearchOptions {
    answers?: ExtractiveQueryAnswer;
    captions?: ExtractiveQueryCaption;
    configurationName?: string;
    debugMode?: string;
    errorMode?: "partial" | "fail";
    maxWaitInMilliseconds?: number;
    queryRewrites?: GenerativeQueryRewrites;
    semanticFields?: string[];
    semanticQuery?: string;
}

Properties

If set, the query returns answers extracted from key passages in the highest ranked documents.

If set, the query returns captions extracted from key passages in the highest ranked documents. When Captions is set to 'extractive', highlighting is enabled by default. Defaults to 'None'.

configurationName?: string

The name of a semantic configuration that will be used when processing documents for queries of type semantic.

debugMode?: string

Enables a debugging tool that can be used to further explore your search results.

errorMode?: "partial" | "fail"

Allows the user to choose whether a semantic call should fail completely, or to return partial results (default).

maxWaitInMilliseconds?: number

Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish processing before the request fails.

queryRewrites?: GenerativeQueryRewrites

When QueryRewrites is set to generative, the query terms are sent to a generate model which will produce 10 (default) rewrites to help increase the recall of the request. Defaults to none.

semanticFields?: string[]

The list of field names used for semantic search.

semanticQuery?: string

Allows setting a separate search query that will be solely used for semantic reranking, semantic captions and semantic answers. Is useful for scenarios where there is a need to use different queries between the base retrieval and ranking phase, and the L2 semantic phase.