Drupal

Opensolr Drupal — find answers to your questions

Drupal Setup with Opensolr

A Drupal site connects to Opensolr in one of three ways. Pick the one that fits what your site runs today; each has its own setup page.

01 · The three ways

Opensolr Search module

A free module that puts your site in an Opensolr Index and gives you a finished search page at /opensolr-search: facets, suggestions as visitors type, search by meaning, analytics and query elevation. It does not use Search API. Start with the Opensolr Search docs.

Search API Opensolr

For sites built on Search API and Views. A connector for Search API Solr that reads the connection from your Opensolr account; its Autoconfigure page creates the Opensolr Index and the Search API server for you. Setup: Drupal Search API Opensolr.

Search API Solr, set up by hand

Plain Search API Solr with its Basic Auth connector, every field filled in yourself. Setup: Drupal Configuration Steps.

02 · Which one for your site

Your siteUse
No site search yet, or you want a finished search pageOpensolr Search module
Search API indexes and Views you want to keepSearch API Opensolr
Search API Solr already set up, moving to OpensolrSearch API Solr, set up by hand

03 · Good to know

The Opensolr Search module and Search API Solr, side by side: how the two compare.

A large Search API site indexes in parallel from Drush with the Opensolr Turbo Indexer.

The Opensolr Search module also serves Drupal AI Search from the same index. The chat bot for your visitors is not part of the module: Opensolr runs it, and one switch in your Opensolr Control Panel shows it on your pages.

Search API Solr cannot connect: Opensolr Connection Issues.

See the module at work on the Drupal demo site.

Read Full Answer

Drupal Configuration Steps

These steps connect Search API Solr to your Opensolr Index by hand. With Search API Opensolr, its Autoconfigure page does all of it for you: Drupal Search API Opensolr.

01 · The server form in Drupal

Under Configuration › Search and metadata › Search API, click Add server, choose the Solr backend and fill it in like this:

FieldValue
Solr ConnectorBasic Auth
HTTP protocolhttps
Solr hostThe Host shown on the Info tab of your index, without https://
Solr port443
Solr path/, a single slash
Solr coreThe name of your index, for example my_index
Username, PasswordThe username and password of your index (under HTTP Basic Authentication)
Solr path is a single slash. Search API Solr adds /solr/ and the core name to the address by itself. The Info tab shows the path as solr/ plus your index name: do not copy it into Solr path, or every request goes to /solr/my_index/solr/my_index and fails.

Indexes in China show port 80 on the Info tab: use http and port 80 for them.

02 · The username and password

A new index uses the username opensolr and your master API key as password. The key is on your Dashboard as Master REST API Key, and under Account › API Keys.

To change them, open the index, click Security, type the new Username and Password under Authentication and click Save. Use letters and digits only: other characters are removed when you save. The new values work after about 10 seconds.

Generating a new API key does not change the password of the indexes you already have.

03 · Upload the Solr configuration

1

Get config.zip

Save the server in Drupal, then click Get config.zip on the server page. Search API Solr builds the files for the Solr version it reads from your index.

2

Upload it

In the Opensolr Control Panel, open your index, click Configuration, choose the zip under Upload Config Zip and click Upload File.

3

Nothing to reload

The progress page saves every file and reloads the index by itself; it ends with ALL DONE!. Details: Upload a ZIP. If the upload reports an error: Can not update/upload configuration files.

04 · Index your content

Add a Search API index on the new server, choose the content and the fields, and click Index now on the page of the index.

Does not connect? Opensolr Connection Issues lists the usual causes.

Read Full Answer

Drupal Search API Opensolr

Search API Opensolr is a free Drupal module for sites that use Search API and Views. It adds a Search API Solr connector that reads the connection of your Opensolr Index from your Opensolr account, so your Search API indexes, Views and processors stay as they are.

01 · Install

composer require drupal/search_api_opensolr
drush en search_api_opensolr

It needs Drupal 10.1 or 11 and brings Search API Solr with it.

02 · Connect your Opensolr account

Open /admin/config/search/search-api/opensolr, enter your Opensolr Email and, in Secret key, your API key (Account › API Keys in the Control Panel), and click Test connection. With the Key module installed, the API key can be kept there instead. The Get started page, /admin/config/search/search-api/opensolr/get-started, ticks off each step as you go.

03 · Autoconfigure

1

Open Autoconfigure

/admin/config/search/search-api/opensolr/autoconfigure lists the Solr environments of your account, with their Solr version, region and country.

2

Pick one and click Start

The module creates an Opensolr Index, creates a Search API server connected to it and uploads the Search API Solr configuration to the index.

3

Add a Search API index

Add an index on the new server, choose your content and fields, and index.

04 · Or add the server yourself

Under Search API, click Add server, choose the Solr backend and the Solr Connector Opensolr with Basic Auth (recommended), then pick your index from the list. The connection is filled in from your account, and the configuration is uploaded to the index when you save. For an index of a cluster, upload it yourself on the Import Config Zip tab of the server.

05 · Security submodule

drush en search_api_opensolr_security

It adds an Opensolr Security tab to the server: change the HTTP Authentication username and password of your index, and add or remove IP restrictions, without leaving Drupal.

06 · Video

Autoconfigure, from an empty site to a connected Search API server.

07 · Related

Big Search API sites index in parallel from Drush with the Opensolr Turbo Indexer.

Without this module: Drupal Configuration Steps.

Connection problems: Opensolr Connection Issues.

All the ways to connect Drupal: Drupal Setup with Opensolr.

Read Full Answer

Loading more articles...