Search code examples
pythonsolrluceneface-recognition

Apache Solr Search for Distance Calculation


Hi I am using Apache solr v8

I need to calculate distance between n-dim vector in query search, how could i do that.

Because I need to calculate distance between face encoding vectors in python's Face_recognition module


Solution

  • Edit: There is a dist function in Solr, see answer provided by the original poster.

    Approximate Near Neighbor (ANN) vector search is not yet natively supported in Solr. There is an ongoing effort to integrate it in both Solr and Lucene. You can find a detailed analysis and track progress on this Solr Jira ticket: https://issues.apache.org/jira/browse/SOLR-14397

    There is also a section "Note on Prior Approaches" on the ticket that summarizes the solutions/workarounds so far for that problem.