xlucene-parser / functions
functions
Enumerations
| Enumeration | Description |
|---|---|
| xLuceneFunction | Enumeration of available xLucene functions. |
Variables
xLuceneFunctions
constxLuceneFunctions:Record<xLuceneFunction,FunctionDefinition>
Defined in: packages/xlucene-parser/src/functions/index.ts:27
Registry of available xLucene function implementations.
Maps function names to their corresponding function definitions that provide the implementation logic.
Functions
initFunction()
initFunction(
config):FunctionMethods
Defined in: packages/xlucene-parser/src/functions/index.ts:57
Initialize a function node with the appropriate implementation.
This function looks up the function implementation based on the node's name and creates an instance configured with the provided variables and type config.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | { node: FunctionNode; type_config: xLuceneTypeConfig; variables?: xLuceneVariables; } | Configuration object |
config.node | FunctionNode | The function node from the AST |
config.type_config | xLuceneTypeConfig | Field type configuration |
config.variables? | xLuceneVariables | Variables for parameter resolution |
Returns
Function methods for matching and query generation
Throws
If the function name is not recognized
Example
const functionMethods = initFunction({
node: geoDistanceNode,
variables: { maxDist: '10km' },
type_config: { location: 'geo' }
});