diff --git a/packages/client-search/src/types/SearchOptions.ts b/packages/client-search/src/types/SearchOptions.ts index f7cca8a00..f1b83fbd9 100644 --- a/packages/client-search/src/types/SearchOptions.ts +++ b/packages/client-search/src/types/SearchOptions.ts @@ -342,4 +342,11 @@ export type SearchOptions = { * results. */ readonly decompoundQuery?: boolean; + + /** + * 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. + */ + readonly relevancyStrictness?: number; }; diff --git a/packages/client-search/src/types/SearchResponse.ts b/packages/client-search/src/types/SearchResponse.ts index b0bbe6a02..2bf309a5d 100644 --- a/packages/client-search/src/types/SearchResponse.ts +++ b/packages/client-search/src/types/SearchResponse.ts @@ -28,6 +28,11 @@ export type SearchResponse = { */ nbHits: number; + /** + * Subset of hits selected when relevancyStrictness is applied. + */ + nbSortedHits?: number; + /** * Number of pages returned. * @@ -215,4 +220,9 @@ export type SearchResponse = { */ params?: Record; }; + + /** + * The relevancy threshold applied to search in a virtual index. + */ + appliedRelevancyStrictness?: number; }; diff --git a/packages/client-search/src/types/Settings.ts b/packages/client-search/src/types/Settings.ts index 326c6d372..5e9b58509 100644 --- a/packages/client-search/src/types/Settings.ts +++ b/packages/client-search/src/types/Settings.ts @@ -297,4 +297,11 @@ export type Settings = { * transliteration to make words indexed in Katakana or Kanji searchable in Hiragana. */ readonly attributesToTransliterate?: readonly 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. + */ + readonly relevancyStrictness?: number; };