Open githubmanticore opened 1 year ago
➤ Stan commented:
still actual
added such query to test 125 and got reply
sphinxql-157> SELECT id, now()-j.lit as t, j from test_json;
id t j
1 1588750657 {"name":"Alice","uid":123,"lon":-0.079858,"lat":0.937717,"pct":12.400000,"sq":9,"poly":"1,2,3,4,5,6.0","points":[1,2,3,4,5,6.000000]}
2 1588750657 {"name":"Bob","uid":234,"gid":12,"lon":-0.079999,"lat":0.891975,"pct":-103.700000,"sq":16,"poly":"1,-2,1,2,-5,6","points":[1,-2,1,2,-5,6]}
3 1588750657 {"name":"Charlie","uid":345,"lon":-0.072146,"lat":0.926761,"pct":4.100000,"sq":225,"poly":"-1,2,12,4,5,6","points":[-1,2,12,4,5,6]}
3 rows in set
seems JSON.attr at expression returns 0.
We could try to fix that by transform expression at filter into form
j.lit IS NOT null and expr
in case expression has JSON attribute, ie NOW() - json.received_at > 3600
will get (json.received_at IS NOT null) AND (NOW() - json.received_at > 3600)
Need to check side effect and pref degradation for such fix.
The 1st match seems to be wrong:
The config is:
I don't even have json.received_at in the document, why would it match with the rule?