Skip to content

Commit

Permalink
fix(types): update FindAnswersOptions (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eunjae Lee authored Mar 4, 2021
1 parent b5b84c1 commit bdf67a5
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion packages/client-search/src/types/FindAnswersOptions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,47 @@
import { SearchOptions } from './SearchOptions';

export type FindAnswersOptions = {
/**
* Attributes to use for predictions.
* If using the default (["*"]), all attributes are used to find answers.
*/
readonly attributesForPrediction?: readonly string[];

/**
* Maximum number of answers to retrieve from the Answers Engine.
* Cannot be greater than 1000.
*/
readonly nbHits?: number;

/**
* Threshold for the answers’ confidence score:
* only answers with extracts that score above this threshold are returned.
*/
readonly threshold?: number;
readonly searchParameters?: SearchOptions;

/**
* Whether the attribute name in which the answer was found should be returned.
* This option is expensive in processing time.
*/
readonly returnExtractAttribute?: boolean;

/**
* Algolia search parameters to use to fetch the hits.
* Can be any search parameter, except:
* - attributesToSnippet
* - hitsPerPage
* - queryType
* - naturalLanguages and associated parameters
* (removeStopWords, ignorePlurals, and removeWordsIfNoResults)
*/
readonly searchParameters?: Omit<
SearchOptions,
| 'attributesToSnippet'
| 'hitsPerPage'
| 'queryType'
| 'naturalLanguages'
| 'removeStopWords'
| 'ignorePlurals'
| 'andremoveWordsIfNoResults'
>;
};

0 comments on commit bdf67a5

Please sign in to comment.