llama-index-opensolr
LlamaIndex integration for Opensolr — managed Apache Solr as a vector store, with server-side embeddings and native hybrid (BM25 + kNN) search.
No local embedding model. No third-party embedding API key. One set of credentials; vectors are computed on Opensolr's GPU infrastructure (multilingual E5-large-instruct, 1024 dimensions, cosine).
Product page: opensolr.com/langchain · free 15-day trial, no card, at opensolr.com
pip install llama-index-opensolr
Quickstart
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="YOUR_OPENSOLR_API_KEY",
create_if_missing=True,
)
embed_model = OpensolrEmbedding(
email="you@example.com", api_key="YOUR_OPENSOLR_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)
print(retriever.retrieve("how do keyword and semantic search combine?"))
Hybrid search
Opensolr fuses BM25 and kNN scores per document with its native
{!hybrid} Solr query parser:
from llama_index.core.vector_stores.types import VectorStoreQuery, VectorStoreQueryMode
result = store.query(VectorStoreQuery(
query_str="affordable restaurants",
similarity_top_k=5,
mode=VectorStoreQueryMode.HYBRID,
alpha=0.5, # 0 = all semantic … 1 = all lexical
))
Metadata filters
Standard LlamaIndex MetadataFilters (EQ, NE, IN, NIN, GT/GTE, LT/LTE) map
to Solr fq — and every index is also plain Apache Solr with the native
/select API when you need facets, highlighting, or anything beyond retrieval.
Notes
- Vector-enabled indexes run on Opensolr's Solr 9.x environments — currently
us(Chicago),de(Germany),fi(Finland). The list is fetched live from the platform; additional dedicated regions can be deployed on request (paid add-on): support@opensolr.com. - Siblings:
langchain-opensolr(LangChain) ·opensolr-mcp(MCP server for agents).
How writing works (Data Ingestion API)
Writes go through Opensolr's Data Ingestion API
— the same pipeline the Drupal and WordPress connectors use. It is
asynchronous: documents are queued, then embeddings, sentiment, language
and all crawler-identical derived fields are computed server-side, and
documents become searchable within about a minute. Progress is visible in the
Opensolr Control Panel and via the ingest_status API. Each document's
identity is its uri (the Solr id is md5(uri)): pass a real URL in
metadata ({"uri": "https://..."}), or a deterministic one is synthesized
from your id. Re-submitting the same uri updates the document. Pass
{"rtf": True, "uri": "https://.../file.pdf"} and the server extracts the
text from PDF/DOCX/XLSX for you.
Lexical-only mode
Don't need vectors? Pure keyword search skips the embedding call entirely — zero AI quota, and it works on any Opensolr index, including non-vector ones and older Solr versions.
Your index schema
Documents follow the Opensolr document model (title, description, text,
meta_* custom fields). To see the full schema: Control Panel → click your
index → Configuration → Edit File → schema.xml. Prefer zero-effort data
entry? Configure the Web Crawler in the Control Panel (Index Tools →
WebCrawler): add your site URL, validate it, and Opensolr indexes the whole
site for you.
MIT license.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_opensolr-0.2.0.tar.gz.
File metadata
- Download URL: llama_index_opensolr-0.2.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89a8eccfe0b92721d7ecfd64b8f72e036959abc1b7c61f4cbe5fa16b76f6b506
|
|
| MD5 |
40fabc56e1d7a4b39c423ec5e7a9cfca
|
|
| BLAKE2b-256 |
a82e104d304b31489346bc8c78364ab45eb5f6ed21f883ad505d090acd372bee
|
File details
Details for the file llama_index_opensolr-0.2.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_opensolr-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cf834647a0d0fdded2f28b2a892ccb68ce2d444edb5bcfb1417f9f766a5f777
|
|
| MD5 |
d093f28a556bfbd69c1a15546a858df2
|
|
| BLAKE2b-256 |
2e16e3ef9bcba5c43983f4846baa7a3393ba1906781a6e89063dfb44b15a6abb
|