Filter on the max knn_dist() via JSON API

Now it is possible to filter knn result and set the maximum knn_dist() via SQL API:

select id, knn_dist() as k1
from test where knn ( image_vector, 5, (0.286569,-0.031816,0.066684,0.032926) ) and k1 < 0.5;

Is it possible to make the same via JSON API?
Thank you.

I’ve figured out.
{“range”: {“knn_dist()”: {“lt”: 0.5}}} inside query[‘knn’][‘filter’] works .

2 Likes