Custom filter for providing raw RediSearch query syntax.
This filter allows you to provide a custom RediSearch query string that will be used as-is without any modification. This is useful when you need to use advanced RediSearch features that are not covered by the other filter types, or when you want complete control over the query syntax.
Warning: When using custom filters, you are responsible for ensuring the query syntax is valid RediSearch syntax. Invalid syntax will cause search queries to fail.
class CustomFilter// Simple custom filter
const filter = new CustomFilter("@category:{electronics}");
// Complex custom filter with multiple conditions
const filter = new CustomFilter("(@category:{electronics} @price:[0 100])");
// Using advanced RediSearch features
const filter = new CustomFilter("@title:(wireless|bluetooth) @price:[50 200]");
// Combining with other filters
const filter = new CustomFilter("@category:{electronics}")
.and(Num("price").lt(100));
// Using the convenience function
const filter = Custom("(@brand:{Apple} @year:[2020 +inf])");Discriminator property for type-safe filter identification. Each filter type has a unique filterType value.
Combine this filter with another using AND logic.
In RediSearch, AND operations are represented by space-separated conditions
within parentheses: (condition1 condition2)
Combine this filter with another using OR logic.
In RediSearch, OR operations are represented by pipe-separated conditions
within parentheses: (condition1|condition2)
Converts the filter expression to a RediSearch query string.