This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
fix(ts): add types for smart sort #809
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 |
---|---|---|
|
@@ -511,6 +511,16 @@ declare namespace algoliasearchHelper { | |
ruleContexts?: string[]; | ||
optionalFilters?: Array<string | string[]>; | ||
queryLanguages?: string[]; | ||
|
||
/** | ||
* A number between 0 and 100 indicating | ||
* how strict the hits will be sorted. | ||
* (dynamically at the query time, not in the indexing time) | ||
* | ||
* 0: No smart sort at all, falling back to the original sort. | ||
* 100: Very smart sort, it will provide only relevant hits. | ||
*/ | ||
relevancyStrictness?: number; | ||
} | ||
|
||
export class SearchParameters implements PlainSearchParameters { | ||
|
@@ -1156,6 +1166,14 @@ declare namespace algoliasearchHelper { | |
* total number of hits of this query on the index | ||
*/ | ||
nbHits: number; | ||
/** | ||
* total number of hits from smart sort | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we use the same descriptions as in the client? algolia/algoliasearch-client-javascript#1251 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh nice, I didn't know they were already there. 107374a |
||
*/ | ||
nbSortedHits?: number; | ||
shortcuts marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/** | ||
* applied relevancyStrictness either from index setting or search parameters (0~100) | ||
*/ | ||
appliedRelevancyStrictness?: number; | ||
/** | ||
* total number of pages with respect to the number of hits per page and the total number of hits | ||
*/ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one likely isn't needed (although can be useful for v3 support)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you tell me why it's not needed?
When we need to set
relevancyStrictness
from the frontend side, we will need it, no?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because the interface inherits from the client type, but in this case we still want to copy it for v3 compact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah got what you mean 👍🏼