A key that only does what the module does
The Drupal module Opensolr Search builds the search of your site on an Opensolr index: indexing, search page, AI answers, chat bot. It works with your master API key, but it does not need everything that key can do. Give it a scoped key made for it instead: one box ticks exactly the endpoints the module calls.
Create the key
- Open Account › API Keys.
- Name this key, for example Drupal site www.example.com.
- Under What may this key do?, tick Drupal: Opensolr Search.
- Under Which indexes may it touch?, keep All of my indexes, or tick only the index this site uses. If the module still has to create the index during setup, keep all, or add a name pattern that matches it.
- Click Create key and copy it.
You do not use the Opensolr Search AI submodule? Untick its endpoints before you create the key.
Put it in Drupal
- Go to Configuration › Search and metadata › Opensolr Search (
/admin/config/search/opensolr). - The Opensolr Email stays the email of your Opensolr account.
- Paste the scoped key as the API Key and save.
The key must be sent with the email of the account that created it, also when a colleague sets up the site.
What the box ticks: 39 endpoints
Opensolr Search
| Endpoint | What the module uses it for |
|---|---|
get_env | Lists the regions you can create the search index in, during setup. |
get_index_list | Lists your indexes so you can connect an existing one. |
create_index | Creates the search index during setup. |
upload_zip_config_files | Uploads the search configuration files to the index during setup. |
reload_core | Reloads the index after setup. |
get_core_info | Reads the address and HTTP password of the index. |
get_settings_dashboard | Fills the settings page: account, crawler and index data in one call. |
get_account_summary | Shows your plan, usage and limits on the settings page. |
add_crawl_url_signed | Gives the index the address of your site map, so your pages get indexed. |
delete_crawler_url | Queues a page you changed, so it is indexed again with the new content. |
start_crawl | Starts indexing your site. |
stop_crawl | Stops indexing. |
pause_crawl | Pauses indexing. |
move_done_to_todo | Queues every page again, to refresh the whole index. |
crawl_schedule_status | Shows whether indexing runs on a schedule. |
crawler_active | Shows whether indexing is running right now. |
get_crawl_stats | Shows how many pages are indexed, queued and failed. |
reset_index | Empties the index, to start over. |
delete_index | Deletes the search index. |
ingest | Sends your content to the index with Data Ingestion. |
elevation_toggle | Turns pinned and excluded results on or off. |
embed | Turns the search query into a vector for hybrid search. |
embed_and_search | Runs a hybrid search in one call. |
ai_summary | Writes the AI answer above the search results. |
image_to_text | Searches with a picture. |
Opensolr Search AI (submodule)
| Endpoint | What the module uses it for |
|---|---|
vdb_info | Checks that the index is ready for Drupal AI vector search. |
vdb_search | Runs a Drupal AI vector search on the index. |
chat_completions | Answers through the Opensolr AI provider in Drupal AI. |
doc_to_text | AI tool: reads a document. |
image_alt_text | AI tool: describes a picture. |
enrich_text | AI tool: analyzes a text. |
ip_geo | AI tool: finds where an address is. |
address_geo | AI tool: finds a place on the map. |
geo_distance | AI tool: measures the distance between two places. |
postal_codes | AI tool: looks up postal codes. |
local_time | AI tool: tells the local time of a place. |
currency_rates | AI tool: converts currencies. |
vat_check | AI tool: checks a VAT number. |
vat_rates | AI tool: looks up VAT rates. |
Good to know
- The module reads the HTTP password of the index with
get_core_info, to search it directly. So this key can read the passwords of the indexes it may touch. - A new version of the module may start calling a new endpoint. If it answers
403 ERROR_SCOPED_KEY_ENDPOINT_NOT_ALLOWED, edit the key and tick the box again. - You can change, revoke or regenerate the key at any time on Account › API Keys. See Authentication and keys.