Searches your index by words and meaning in one ranking, with the hybrid search of the hosted search page, and groups the results: one per Drupal entity, or one per page or document.
https://api.opensolr.com/solr_manager/api/vdb_searchemail and api_key of your account, as GET or POST parameters: Authentication.01 · Parameters
index_nameRequiredYour index.
keysOptionalThe search text, up to 2000 characters. Without it: the latest documents.
siteOptional1: every document of the index, one result per page or document. Default: only documents of Drupal entities, one result per entity.
modeOptionallexical: words only, no vector. Default: words and meaning.
vectorOptionalYour own query vector, of the size vdb_info gives. Without it, the words are turned into one.
limit, offsetOptionallimit 1 to 100, default 10. offset up to 10000.
languagesOptionalOnly these languages, such as ["en","de"].
from, toOptionalOnly documents created between these days, YYYY-MM-DD.
freshOptional1 favours recent documents, 0 does not. Default: the Search Tuning of the index.
passagesOptionalAlso give each result about this many characters of its text around the words, 200 to 10000: for a chat bot.
excludeOptionalDrupal entity ids to leave out.
02 · Example
curl -s "https://api.opensolr.com/solr_manager/api/vdb_search?email=YOUR_EMAIL&api_key=YOUR_API_KEY&index_name=my_index&site=1&limit=5" --data-urlencode "keys=how to assemble the blue chair"
03 · Answer
{ "status": true, "num_found": 12, "results": [ { "id": "...", "drupal_entity_id": "", "title": "Blue chair manual", "uri": "https://www.example.com/manuals/blue-chair.pdf#page=3", "content": "... <em>assemble</em> the legs first ...", "price": null, "currency": null, "date": "...", "distance": 0.82, "highlighted_fields": { "title": [ "..." ], "body": [ "..." ] }, "pages": [ { "id": "...", "page": 4, "uri": "https://www.example.com/manuals/blue-chair.pdf#page=4", "title": "...", "snippet": "..." } ] } ] }
pages holds the other matching pages of the same document. A PDF result links its page. With passages, each result and page also has passage. Values shown are an example.
When the words are turned into a vector here, that counts one AI request; a vector sent by you, or a search made before, costs nothing. Every plan includes a monthly allowance of AI requests: API Quota, Pricing. The allowance used is the one of the account that owns the index.
04 · Errors
VECTOR_NOT_ALLOWEDHTTP 200AI is switched off on the plan of the index owner.
ERROR_EMBEDDING_SERVICE_UNAVAILABLEHTTP 200The embedding model did not answer. Retry, or use mode=lexical.
ERROR_SOLR_SEARCHHTTP 200The index did not answer the search; detail says why.
ERROR_NOT_CORE_OWNERHTTP 200The index is not yours.
WRONG_API_HOSTHTTP 404Called on opensolr.com.
ERROR_AUTHENTICATION_FAILEDHTTP 403The email and API key do not match.
05 · Related
Hybrid search with the hosted search page answer: embed_and_search.
Every error code and HTTP status of the API: API errors. Calls per minute and per hour: Rate limits.