Skip to content
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 4 commits into from Feb 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions index.d.ts
Expand Up @@ -511,6 +511,13 @@ declare namespace algoliasearchHelper {
ruleContexts?: string[];
optionalFilters?: Array<string | string[]>;
queryLanguages?: string[];

/**
* The relevancy threshold to apply to search in a virtual index [0-100]. A Bigger
* value means fewer, but more relevant results, smaller value means more, but
* less relevant results.
*/
relevancyStrictness?: number;
Copy link
Contributor

@Haroenv Haroenv Feb 9, 2021

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)

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor Author

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 👍🏼

}

export class SearchParameters implements PlainSearchParameters {
Expand Down Expand Up @@ -1156,6 +1163,14 @@ declare namespace algoliasearchHelper {
* total number of hits of this query on the index
*/
nbHits: number;
/**
* subset of hits selected when relevancyStrictness is applied
*/
nbSortedHits?: number;
shortcuts marked this conversation as resolved.
Show resolved Hide resolved
/**
* the relevancy threshold applied to search in a virtual index
*/
appliedRelevancyStrictness?: number;
/**
* total number of pages with respect to the number of hits per page and the total number of hits
*/
Expand Down