Hi,

I have been looking around on the web for information on sorting by a
custom function but the results are inconclusive to me and some of it seems
so old that I suspect it's outdated. What I want to do is the following:

I have a field "fingerprint" in my schema that contains a binary data (e.g.
64 bytes) that can be used to compute a distance/similarity between two
records.

Now I want to be able to execute a query and sort its result by the
distance of the matching records from a given reference value, so the query
would look something like this

q=*:*&sort=my_distance_func(fingerprint, 0xadet54786eguizgig)

where

my_distance_func is my custom function
fingerprint is the field in my schema (type binary)
0xadet54786eguizgig is a reference value (byte array encoded in whatever
way) to which the distance shall be computed, which differs with each query.

Is ValueSourceParser the right way to look here? Is there a source code
example someone can point me to?

Thanks in advance,

Robert

Reply via email to