From f6da6253801f706372577710aca45cd0aa41ea83 Mon Sep 17 00:00:00 2001 From: Fanis Tharropoulos Date: Thu, 29 Aug 2024 11:17:24 +0300 Subject: [PATCH] feat(search_params): add drop_tokens_mode to search params interface - Introduce the `drop_tokens_mode` parameter to the `SearchParams` interface, allowing more fine-grained control over token dropping behavior during search operations. --- src/Typesense/Documents.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Typesense/Documents.ts b/src/Typesense/Documents.ts index 9493dcba..1be93e9b 100644 --- a/src/Typesense/Documents.ts +++ b/src/Typesense/Documents.ts @@ -34,6 +34,11 @@ export interface SearchParamsWithPreset extends Partial { preset: string; } +type DropTokensMode = + | "right_to_left" + | "left_to_right" + | "both_sides:3"; + type OperationMode = "off" | "always" | "fallback"; export interface SearchParams { // From https://typesense.org/docs/latest/api/documents.html#arguments @@ -71,6 +76,7 @@ export interface SearchParams { split_join_tokens?: OperationMode; exhaustive_search?: boolean; drop_tokens_threshold?: number; // default: 10 + drop_tokens_mode?: DropTokensMode; typo_tokens_threshold?: number; // default: 100 pinned_hits?: string | string[]; hidden_hits?: string | string[];