You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "adityamparikh (via GitHub)" <gi...@apache.org> on 2026/10/03 17:51:48 UTC

Re: [I] Semantic / Hybrid Search using MCP server [solr-mcp]

adityamparikh commented on issue #64:
URL: https://github.com/apache/solr-mcp/issues/64#issuecomment-5971847309

   Design inputs for whoever picks this up, checked on 2026-10-03:
   
   **Fusion has to happen in the server.** Solr's JSON Combined Query DSL (native RRF) is documented only in the 9.11-beta reference guide; the 10.0 guide doesn't have it, so no version in our supported range (8.11 to 10) offers it. Spring AI 2.0.1's `spring-ai-rag` ships only `ConcatenationDocumentJoiner`, with no RRF joiner. `hybrid-search` therefore needs its own RRF merge (`k = 60`, de-duplicated by `uniqueKey`, deterministic tie-break). Writing it for N ranked lists, not just two, would allow multi-query fusion later without a rewrite.
   
   **The server can stay keyless.** `spring-ai-starter-model-transformers` embeds in-process through ONNX (default `all-MiniLM-L6-v2`, 384 dimensions, no API key), so in-server embeddings don't have to mean an OpenAI dependency. Points for a short spike before building on it:
   - whether ONNX Runtime and the DJL tokenizers work in the GraalVM native images (unverified; the JVM image may end up being the only one with embeddings);
   - the model downloads from Hugging Face on first use, so bundle it in the image or document `spring.ai.embedding.transformer.cache.directory` for air-gapped installs;
   - check the field's `vectorDimension` against the model's, with a clear error when a collection was embedded by a different model.
   
   **Separate inputs per leg.** Give `hybrid-search` a `keywordQuery` (BM25) and a `vectorText` (kNN). An MCP client can then send a hypothetical answer passage (HyDE) for the vector leg without BM25 matching that prose, and without the server needing an LLM.
   
   **Stopgap for operators who already run Solr's text-to-vector module.** `{!knn_text_to_vector model=<m> f=<field> topK=10}<text>` already works through `search`'s `q` pass-through. It needs the `llm` module (9.x) or `language-models` module (10.x), which `-slim` images don't include, plus a provider key configured on the Solr side. It is worth a line in the docs, but it doesn't replace this issue.
   
   **Upstream home.** spring-projects/spring-ai#4782 (Solr `VectorStore`) has had no response since 2025-11-02, so porting `SolrVectorStore` here is still the realistic path. Since that means Spring AI 2.0 APIs, this fits the `sb4` / 2.0 line better than `main`.
   
   Related, and needing no embeddings: #240 (`find-similar`, More Like This) and #241 (`list-fields`).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org