LlamaIndex retrieval on managed Apache Solr
OpensolrVectorStore + OpensolrEmbedding: server-side GPU embeddings, native hybrid query mode, and standard metadata filters — no local model, no vector database to run.
Quickstart
Standard LlamaIndex interfaces — swap in Opensolr and your index, retriever, and query engine work unchanged.
from llama_index.core import VectorStoreIndex, StorageContext, Document from llama_index.vector_stores.opensolr import OpensolrVectorStore from llama_index.embeddings.opensolr import OpensolrEmbedding store = OpensolrVectorStore(index_name="mysite__dense", email="you@example.com", api_key="...", create_if_missing=True) embed_model = OpensolrEmbedding(email="you@example.com", api_key="...", index_name="mysite__dense") index = VectorStoreIndex.from_documents( [Document(text="Hybrid search fuses BM25 with vector similarity")], storage_context=StorageContext.from_defaults(vector_store=store), embed_model=embed_model, ) retriever = index.as_retriever(similarity_top_k=5)
Try it without an account
A public demo account, so the quickstart above runs before you decide anything.
export OPENSOLR_EMAIL=mcp@opensolr.com export OPENSOLR_API_KEY=420b8b23e7b12dc8ab838932145a5065
The index mcp_demo_d1__dense is already loaded with 300 news articles, so search, filtering and grounded answers work the moment you connect. You also get the write path: create your own index on the account, ingest into it and query it. Deletion is not available on this shared key — no index here can be deleted or reconfigured by hand. Whatever you create is removed automatically after 3 days.
- Anything you create there is deleted after 3 days. Automatically, without warning or export — indexes you created included.
- The account is shared with everyone reading this page. Your index is visible to them and they can add documents to it, as you can to theirs. Nobody can delete or reconfigure an index here — that is switched off for this key — but never put anything real, private or client-owned in it.
- The limits are per index, and deliberately small. 200 MB of bandwidth and 50 MB of disk per index. Bandwidth is the one you will hit first: it covers a demo, a tutorial and a proof of concept, and it will not carry an application.
When you want an index that is private, yours and still there next week, get your own key — free 15-day trial, no card — and change the two variables above. Nothing else in your code changes.
What you get
The pieces most vector stores in the directory make you assemble yourself.
Server-side embeddings
1024-dim multilingual E5, computed on Opensolr's GPU infrastructure at both index and query time. No OpenAI key, no sentence-transformers install.
True HYBRID query mode
VectorStoreQueryMode.HYBRID with tunable alpha fuses BM25 and kNN scores per document via Opensolr's native {!hybrid} Solr parser — not client-side score juggling.
Standard filters, real Solr
MetadataFilters (EQ, NE, IN, NIN, ranges) map to Solr fq. And every index is plain Apache Solr underneath — facets, highlighting, the whole /select API.
Also available for: LangChain · MCP / AI Agents · Haystack · Laravel
Your Search Tuning follows you
Relevance is configured once, in your Control Panel — not re-implemented in every codebase.
- Saved per index: everything you set in Index Settings → Search Tuning (semantic↔lexical balance, field weights, minimum match, search mode, vector candidate pool, content quality boost) is stored with your index.
- Applies automatically here: every search and every RAG answer from this integration runs through the same tuned pipeline as your hosted search page — change a slider in the Control Panel and the very next query uses it. No redeploy, no code change.
- Overridable per call:
tuning={"search_mode": "keywords_required", "fw_title": 0.2, "mm": "strict"}beats the saved settings for that one request. Defaults match the platform exactly when you send nothing. - Fresh Results Bias: pass
fresh_biasto rank newer documents higher — scores are multiplied by a recency curve oncreation_date. It re-orders and never filters: the hit count is unchanged and undated documents keep their place. This is the same control visitors get as the Fresh toggle on the hosted search page. Not to be confused withfreshness_boost, which is a hard date window in days and does remove results.
Tested on our own production index
Every release runs a live end-to-end suite against real Opensolr infrastructure — no mocks.
- Full write path through the async Data Ingestion queue: queued → server-side embeddings & enrichment → searchable, with metadata and id round-trips verified. Metadata lands in typed Solr fields; the suffixes and what they enable are in the Vector Search Schema Reference.
- Real-corpus retrieval against a replica of opensolr.com's own search index: pure-semantic hits with zero keyword overlap („how do I get my data back after a disaster” → backup docs), cross-lingual queries (Romanian → English content), all hybrid modes and the full alpha range.
- PDF ingestion via
rtf:true: server-side text extraction and content-type detection, then semantic retrieval from the extracted content. - Grounded RAG answers: one call runs hybrid retrieval and feeds the top hits to the LLM (configurable docs/words, custom instruction) — verified with a question answerable only from the ingested PDF.
- LlamaIndex specifics: HYBRID and TEXT_SEARCH query modes, MetadataFilters (EQ / IN), node-id round-trip through
meta_ext_id.
Build your RAG pipeline on managed Solr
Free 15-day trial, no credit card — the included AI quota covers the whole quickstart.