Experimental project
This is a sandbox project, which contains experimental code for developer use only.
The search_api_solr_densevector module is a proof of concept that demonstrates how Solr Dense Vector fields could be integrated with the Search API Solr module for Drupal. This allows for neural searches, and potentially other applications like RAG. This is a work-in-progress intended more for testing purposes than production use.
Limitations
Right now a dense vector field can only store a single vector of up to 1024 dimensions. But, in most neural search and RAG implementations that involve large bodies of text (like a Drupal node) it’s best practice to chunk your text into sentences or paragraphs and generate vectors for those chunks rather than the entire article. As of Solr 9.1 if you chunk your node into sentences you would either need a field per sentence on the solr document, or a solr document per sentence. Both of these seem … not awesome. Search API very much wants to create a Solr document per node.
There’s ongoing work to add the multi-value vector fields to Lucene but it’s not ready yet - https://github.com/apache/lucene/issues/12313 - Once that’s done however I think this could work well.
The current implementation is potentially useful if you're only needing to vectorize a small chunk of text, or images, or user personalization data, but for generic integration with the existing Search API architecture it's not a good fit ... yet.
For more details about implementation and progress see https://www.drupal.org/project/search_api_solr/issues/3397950
REQUIREMENTS
This module requires:
- The latest versions of Search API & Search API Solr contributed modules
- Search API Solr module must have the included ./search_api_solr-dense-vector.patch patch applied.
- A Solr 9.1+ server
- A Hugging Face inference API key
INSTALLATION
Install as you would normally install a contributed Drupal module.
See: https://www.drupal.org/node/895232 for further information.
Add your Hugging Face API key in settings.php:
$settings['search_api_solr_densevector_hugging_face_key'] = '';
Configure a field in your Search API Solr index to use the DenseVector field type.
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.- Project categories: Site search
- Ecosystem: Search API, Search API Solr
- By eojthebrave on , updated
