This tutorial will show you how to test and explore your OpenSolr Vector Search Engine with real examples, including API queries, curl commands, and code snippets in PHP, AJAX, and Python.
OpenSolr lets you build a complete AI-powered search pipeline:
Crawl → Index → Embed → Solr → Search
You can create this entire flow out of the box using the OpenSolr Web Crawler Site Search Solution:
👉 https://opensolr.com/faq/view/web-crawler/46/opensolr-web-crawler-site-search-solution
For setup details, assistance, or pricing information, contact us at:
📧 [email protected]
You can test your vector search engine directly here:
👉 https://opensolr.com/search/vector?topbar=block&q=climate+disasters+hurricanes+floods+wildfires&in=web&og=yes&locale=&duration=&source=&fresh=yes&lang=
Try using conceptual queries (semantic rather than literal):
climate disasters hurricanes floods wildfiresspace exploration mars colonization economyancient microbes life beyond earthThese queries will show how your embeddings and vector similarity work in practice.
Solr Core Example:
https://de9.solrcluster.com/solr/vector/select?wt=json&indent=true&q=*:*&rows=2
Username: 123
Password: 123
curl -u 123:123 "https://de9.solrcluster.com/solr/vector/select?q=climate+change&rows=5&wt=json"
curl -u 123:123 "https://de9.solrcluster.com/solr/vector/select?q={!knn%20f=embeddings%20topK=50}[0.123,0.432,0.556,...]&wt=json"
Replace the vector array with your own embedding from the OpenSolr AI NLP API.
curl -u 123:123 "https://de9.solrcluster.com/solr/vector/select?q={!bool%20should=$lexicalQuery%20should=$vectorQuery}&lexicalQuery={!edismax%20qf=content}climate+change&vectorQuery={!knn%20f=embeddings%20topK=50}[0.12,0.43,0.66,...]&wt=json"
This version mixes traditional keyword scoring with semantic similarity — best of both worlds.
You can generate embeddings for any text or document using these API endpoints:
Example:
curl -X POST https://opensolr.com/api/nlp/embed -d '{"text": "climate change impact on crops"}' -H "Content-Type: application/json"
Response will include the vector embedding array you can pass to Solr.
<?php $url = 'https://de9.solrcluster.com/solr/vector/select?wt=json'; $query = '{!bool should=$lexicalQuery should=$vectorQuery}'; $params = [ 'lexicalQuery' => '{!edismax qf=content}climate disasters', 'vectorQuery' => '{!knn f=embeddings topK=50}[0.12,0.43,0.56,0.77]' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_USERPWD, '123:123'); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>
<script> fetch('https://de9.solrcluster.com/solr/vector/select?wt=json&q={!knn%20f=embeddings%20topK=10}[0.11,0.22,0.33]', { headers: { 'Authorization': 'Basic ' + btoa('123:123') } }) .then(r => r.json()) .then(console.log); </script>
import requests from requests.auth import HTTPBasicAuth url = "https://de9.solrcluster.com/solr/vector/select" params = { 'q': '{!bool should=$lexicalQuery should=$vectorQuery}', 'lexicalQuery': '{!edismax qf=content}climate disasters', 'vectorQuery': '{!knn f=embeddings topK=50}[0.12,0.43,0.56,0.77]', 'wt': 'json' } response = requests.post(url, data=params, auth=HTTPBasicAuth('123', '123')) print(response.json())
topK to control how many similar results you want (usually 20–100).{!bool should=should} instead of must, the vector similarity will have more influence on ranking.To get started or request a ready-to-use search engine setup:
📧 [email protected]