Skip to content

Commit

Permalink
feat: support exhaustive_search (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
geisterfurz007 authored Nov 1, 2022
1 parent 8f10a15 commit ca2b235
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Typesense/SearchParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ public record SearchParameters
[JsonPropertyName("num_typos")]
public string? NumberOfTypos { get; set; }

/// <summary>
/// Whether all variations of prefixes and typo corrections should be considered,
/// without stopping early when enough results are found.
/// Ignores DropTokensThreshold and TypoTokensThreshold.
/// </summary>
[JsonPropertyName("exhaustive_search")]
public bool? ExhaustiveSearch { get; set; }

/// <summary>
/// Results from this specific page number would be fetched.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions src/Typesense/TypesenseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,8 @@ private static string CreateUrlSearchParameters(SearchParameters searchParameter
urlParameters += $"&facet_query_num_typos={searchParameters.FacetQueryNumberTypos.Value.ToString().ToLowerInvariant()}";
if (searchParameters.Infix is not null)
urlParameters += $"&infix={searchParameters.Infix}";
if (searchParameters.ExhaustiveSearch is not null)
urlParameters += $"&exhaustive_search={searchParameters.ExhaustiveSearch.Value.ToString().ToLowerInvariant()}";

if (searchParameters is GroupedSearchParameters groupedSearchParameters)
{
Expand Down

0 comments on commit ca2b235

Please sign in to comment.