Create a custom filter with raw RediSearch query syntax.
This is a convenience function for creating custom filters that use raw RediSearch query syntax. The provided query string will be used as-is without any modification.
Use this when you need advanced RediSearch features not covered by the other filter types, or when you want complete control over the query syntax.
Warning: You are responsible for ensuring the query syntax is valid RediSearch syntax.
Custom(query: string): CustomFilter| Name | Type | Description |
|---|---|---|
query* | string | The raw RediSearch query string |
// Simple custom query
const filter = Custom("@category:{electronics}");
// Complex query with multiple conditions
const filter = Custom("(@category:{electronics} @price:[0 100])");
// Advanced RediSearch features
const filter = Custom("@title:(wireless|bluetooth) @price:[50 200]");
// Combine with other filters
const complexFilter = Custom("@category:{electronics}")
.and(Num("price").lt(100));