Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(search_params): add drop_tokens_mode to search params interface #227

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Typesense/Documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ export interface SearchParamsWithPreset extends Partial<SearchParams> {
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
Expand Down Expand Up @@ -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[];
Expand Down
Loading