Problem/Motivation
It would be nice if this module be compatible with RAG/Vector search AiFunctionCall provided by ai_search module. This function is used by ai assistants / ai chatbot. So, implementing this will allow that chatbot queries be looked up by
solr indexes using this module.
Trying to configure RAG/Vector search using an index that uses this vector, results in nothing because the RAG/Vector search plugin expects there exists data at 'content' extraData
Proposed resolution
Adding the Dense vector fields to the 'content' extraData at the solr_densevector processor.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Screenshot From 2025-09-17 12-14-45.png | 49.76 KB | kevinquillen |
Issue fork search_api_solr_dense_vector-3547257
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
omarlopesinoComment #3
kevinquillen commentedI spent yesterday looking into this for the first time (RAG tool with AI Chatbot) and in the cases where you want to use a View or different Solr options (parse mode, dismax/edismax, etc) its lost in the tool because its called and executed directly. This was causing me to never get any results.
That caused me to write my own plugin like:
This produced results. I could also confirm that the event subscriber in this module was also fired, so it performed a RAG search against Solr. These are probably items to report back to the main ai_search module because it can be a little confusing when the RAG tool returns nothing. I see that ai_search module provides its own search backend that creates the content property.
Anyway, if I add that event to the current query event subscriber:
I can see the extra data in the result on the FunctionCall plugin I made. Perhaps the shortest solution here is adding on the processor setting to ask the user "which" field should be returned as 'content' in this context.
Comment #4
kevinquillen commentedSomething like this perhaps?
Comment #5
kevinquillen commentedA more complete example may look something like this:
I tested this using the node title field only.
Comment #6
omarlopesinoThat looks good and easy to configure. I can check this approach in my site, and even creating an MR from #5 so it can be reviewed.
Comment #8
omarlopesinoI have tested the MR based on #5 in a project with search api solr dense vector and an AI chatbot that uses RAG/Vector search and it works fine. Thanks!
Moving to Needs review.
Comment #9
kevinquillen commentedI've added some additional touches.
Comment #10
omarlopesinoI have checked it in my project and the data is correctly stored and used by the chatbot. So it works fine.
Comment #11
kevinquillen commentedComment #14
omarlopesinoThank you!