Skip to content

Commit 110acf5

Browse files
authored
added filter_by and tags to SearchOverride Rule, and removed the breaking null checks (#278)
1 parent a28f50b commit 110acf5

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/Typesense/SearchOverride.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,28 @@ public Include(string id, int position)
3939
public record Rule
4040
{
4141
[JsonPropertyName("query")]
42-
public string Query { get; init; }
42+
public string? Query { get; init; }
4343

4444
[JsonPropertyName("match")]
45-
public string Match { get; init; }
45+
public string? Match { get; init; }
46+
47+
[JsonPropertyName("filter_by")]
48+
public string? FilterBy { get; init; }
49+
50+
[JsonPropertyName("tags")]
51+
public IEnumerable<string>? Tags { get; init; }
4652

4753
[JsonConstructor]
48-
public Rule(string query, string match)
54+
public Rule(
55+
string? query = null,
56+
string? match = null,
57+
string? filterBy = null,
58+
IEnumerable<string>? tags = null)
4959
{
50-
if (string.IsNullOrWhiteSpace(query))
51-
throw new ArgumentException("cannot be null or whitespace.", nameof(query));
52-
if (string.IsNullOrWhiteSpace(match))
53-
throw new ArgumentException("cannot be null or whitespace.", nameof(match));
5460
Match = match;
5561
Query = query;
62+
FilterBy = filterBy;
63+
Tags = tags;
5664
}
5765
}
5866

0 commit comments

Comments
 (0)