Custom Solr Search module provides the option to search the keyword across the multiple Solr servers / cores which is already indexed(Including the External Solr Servers). Currently it is depended on Search API Solr Search for getting the details of Solr Servers which will be saved under the path "/admin/config/search/search-api"
As like apachesolr_drupal_query in Drupal 7 . This module provides a service.

Why or When to use Custom Solr Search?

  1. To Search the key word on External Solr Servers.
  2. To Search across multiple Solr Servers or Cores.
    //To search the keyword across all the server which you added on the '/admin/config/search/search-api'
    <?php
           /**
             * @param string $keyword
             *   The key word to search.
             */
    $searchResults = \Drupal::service('custom_solr_search.search_all')->searchAll($keyword);
    ?>
  3. Chose the Solr Server or Core to search the Particular Key word.
    <?php
           /**
             * @param string $keyword
             *   The key word to search.
             * @param string $server
             *   Machine name of the server which you were added on 
             *   'admin/config/search/search-api'. For getting the machine name you
             *   need to edit the  one of the server configuration on the 
             *   'admin/config/search/search-api'
             */
            $results = \Drupal::service('custom_solr_search.search')->basicSearch($keyword, 0, 5, $server);
    ?>

Search Results page and Customization (Usage)

The default search form and results provided by the module under the path '/custom/search'. Or if you want to do more customization you can create separate controller and call the above Services.

How to Install?

  1. Download custom_solr_search, composer_manager, search_api & search_api_solr modules into /modules directory under Drupal root folder.
  2. Run composer update and make sure Solarium library is been download. Run the following command from Drupal root folder:
    composer drupal-update
  3. Enable custom_solr_search module.

Note:

  1. Minimum required Solarium library version: 3.6.0

    Project Information

    Downloads