From af5c1240a9968ff06c25e0d45516d4de8cc5520a Mon Sep 17 00:00:00 2001 From: Alphonse Bouy Date: Thu, 6 Jan 2022 11:04:57 +0100 Subject: [PATCH 1/2] feat(types): add reranking engine settings to types --- .../client-search/src/types/SearchOptions.ts | 8 ++++++++ packages/client-search/src/types/Settings.ts | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/packages/client-search/src/types/SearchOptions.ts b/packages/client-search/src/types/SearchOptions.ts index b5b178408..cbfd77652 100644 --- a/packages/client-search/src/types/SearchOptions.ts +++ b/packages/client-search/src/types/SearchOptions.ts @@ -359,4 +359,12 @@ export type SearchOptions = { * This parameter is only used to turn off Dynamic Re-Ranking (with false) at search time. */ readonly enableReRanking?: boolean; + + /** + * When Dynamic Re-Ranking is enabled, only records that match these filters will be impacted by Dynamic Re-Ranking. + */ + readonly reRankingApplyFilter?: + | string + | readonly string[] + | ReadonlyArray; }; diff --git a/packages/client-search/src/types/Settings.ts b/packages/client-search/src/types/Settings.ts index 7797639d7..26f99ae9c 100644 --- a/packages/client-search/src/types/Settings.ts +++ b/packages/client-search/src/types/Settings.ts @@ -343,4 +343,21 @@ export type Settings = { }; }; }; + + /** + * Whether this index should use Dynamic Re-Ranking. + * @link https://www.algolia.com/doc/guides/algolia-ai/re-ranking/ + * + * Note: In order for this parameter to work, the index needs to be opted in to the Dynamic Re-Ranking feature, if your plan allows it. + * This can be done in the dashboard. + */ + readonly enableReRanking?: boolean; + + /** + * When Dynamic Re-Ranking is enabled, only records that match these filters will be impacted by Dynamic Re-Ranking. + */ + readonly reRankingApplyFilter?: + | string + | readonly string[] + | ReadonlyArray; }; From 7b4d607b71f525776dd21ed08e8c552240a51c64 Mon Sep 17 00:00:00 2001 From: Alphonse Bouy Date: Thu, 6 Jan 2022 14:53:42 +0100 Subject: [PATCH 2/2] chore: fix description --- packages/client-search/src/types/Settings.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client-search/src/types/Settings.ts b/packages/client-search/src/types/Settings.ts index 26f99ae9c..ba2118f00 100644 --- a/packages/client-search/src/types/Settings.ts +++ b/packages/client-search/src/types/Settings.ts @@ -348,8 +348,8 @@ export type Settings = { * Whether this index should use Dynamic Re-Ranking. * @link https://www.algolia.com/doc/guides/algolia-ai/re-ranking/ * - * Note: In order for this parameter to work, the index needs to be opted in to the Dynamic Re-Ranking feature, if your plan allows it. - * This can be done in the dashboard. + * Note: You need to turn on Dynamic Re-Ranking on your index for it to have an effect on + * your search results. You can do this through the Re-Ranking page on the dashboard. */ readonly enableReRanking?: boolean;