lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Kr├╝ger <>
Subject Example of sorting by custom function
Date Fri, 03 Apr 2015 13:44:43 GMT

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

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)


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,


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message