Skip to content

fix(types): update FindAnswersOptions #1258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
>;
};