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

fix(ts): add types for smart sort #809

merged 4 commits into from Feb 10, 2021

Conversation

eunjae-lee
Copy link
Contributor

@eunjae-lee eunjae-lee commented Feb 9, 2021

Summary

This PR adds the following types for smart sort

  • relevancyStrictness in the search parameter
  • nbSortedHits and appliedRelevancyStrictness in the search response

index.d.ts Show resolved Hide resolved
index.d.ts Outdated
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, I didn't know they were already there. 107374a

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

@eunjae-lee eunjae-lee merged commit 236822e into develop Feb 10, 2021
@eunjae-lee eunjae-lee deleted the fix/smart-sort branch February 10, 2021 10:25
eunjae-lee added a commit that referenced this pull request Feb 10, 2021
 * chore: update yarn.lock 4f9360c
 * fix(ts): add types for smart sort (#809) 236822e
 * fix(ts): make queryID optional (#806) 67ad89b
dhayab pushed a commit to algolia/instantsearch that referenced this pull request Jul 10, 2023
* fix(ts): add types for smart sort

* chore: update comments
dhayab pushed a commit to algolia/instantsearch that referenced this pull request Jul 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants