Search API Solr Datasource is a Drupal 8 module that provides a datasource plugin for Search API indexes. The plugin exposes documents from any Solr server to the index, providing the ability to search and view those documents, regardless of whether or not they were originally indexed by Drupal.
This module is still under development and should be considered pre-alpha, unstable, and unsecure. It is recommended that you only use this module in development environments.
Issues, patches, and pull requests are welcome in the GitHub repository. This module is being developed exclusively during my personal free time. If you would like to speed this project along, feel free to contribute code or contact me, dcameron, to sponsor the development.
These steps have not been tested from a base Drupal install, but they should work to get a development environment running.
- Download the module or clone it with Git into your Drupal 8 site's modules directory. Enable the module.
- Add and configure a Search API server that uses the Solr backend.
- Configure this server with the connection information for the Solr server that contains the indexed data you want to display.
- It may be necessary to check "Retrieve result data from Solr."
- Add a Search API index for the server you configured in step 2.
- Check "Solr Document" under the list of Data Sources.
- Configure the Solr Document Datasource by specifying the name of a unique ID field from your server's schema.
- Finish configuring the index by selecting the appropriate server. Check "Read only" under the Index Options.
- On the index's Fields tab, add the fields you would like to have shown in Views or any other display. Fields must be added here first before they can be displayed, despite appearing in the Add fields list in Views.
- Create a view or some other display to see the documents from your server. If
you are using Views, set it up as you would for any other Search API
datasource.
- In the Add view wizard, select "Index INDEX_NAME" under the View Settings.
- Configure the view to display fields.
- Add the fields that you want to display.
Check the issue queue for an up-to-date list.
- Search API Solr's backend unsets the ID field that you configure in the datasource settings from the results arrays, making it unavailable for display.