Query ranking functions and ExprTK syntax
I'm trying to add a query ranking function that boosts the items closest to a set of locations.
It looks like this:
$qrf(expression:'min(dist(@lat1, @long1, 30, -100),dist(@lat2, @long2 ,30,-100)', normalizeWeight: true)
The problem is that lat1, long1, lat2, long2 aren't always set. ExprTK has an if construct, but it doesn't seem to work.
$qf(function:'if((3 == 3),7,9)', fieldName: 'tester') but that doesn't return anything in the results.
ExprTK has lot of other functions, but none of the ideas I had seem to work. Taking the absolute value of the empty field doesn't coerce into a number, for instance.
How can I handle empty fields in a query ranking function?
Hi, Control statements, like the if statement, have been disabled for security reasons.
I don't think that there is a way to handle your specific problem with the way we expose the ExprTK library…