-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): update FindAnswersOptions (#1258)
- Loading branch information
Eunjae Lee
authored
Mar 4, 2021
1 parent
b5b84c1
commit bdf67a5
Showing
1 changed file
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
>; | ||
}; |