A search filter is a WebAssembly (Wasm) module used to extend Yōzefu's search engine with custom logic that the standard query syntax cannot express (e.g., checking if a Kafka key ends with a specific suffix).
To use a filter in a query, the name of the function in your SQL-like syntax must match the name of the .wasm file. For example, a query using key-ends-with('1234') requires a Wasm file named key-ends-with.wasm.
Search filters are implemented using Extism and must export two specific functions:
parse_parameters: Validates user-provided arguments during the parsing phase.matches: Evaluates every Kafka record against the provided parameters to determine if it should be included in the results.
You can locate your existing Wasm filters by running yozf config get filters-dir.
-- Example usage of a custom filter named 'key-ends-with'
from begin where key-ends-with('1234')