Vector based search in solr

Viewed 274

I am trying to implement dense vector based search in solr (currently using version 8.5.2). My requirement is

  1. to store a dense vector representation for each document in solr in a field called vectorForm.
  2. Now when a user issues some query, I am converting that query to some dense vector representation as well and now I want to get top 100 documents from solr that have highest dotProduct value between the query vector representation and vectorForm field (stored for each document above) in solr.

A few questions that I had around this are

  1. What field type should be used to define the vectorForm field (does docValues with multiValued integers work best here)?
  2. How do I efficiently do the above vector based retrieval? (keeping in mind that latency should be as low as possible)

I read that solr has dotProduct and cosinSimilarity functions but not able to understand how to use it here in my case, if thats the solution then any link towards an example implementation will help.

Any help or guidance will be a huge help for me.

1 Answers
Related