Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Drupal 8/9 module provide Federated Search with a shared Solr core. It also integrates Ajax Solr library to Drupal.

License

Notifications You must be signed in to change notification settings

digitalutsc/ajax_solr_search

Repository files navigation

Ajax Solr for Drupal

Introduction

Drupal 8/9 module provides a user interface for the Federated Search for multiple Drupal sites which index their content into a single shared Solr Core.

Based project:

  • Ajax Solr is the JavaScript library which provide web based user interface to Apache Solr. The module integrates the library into Drupal framework.

Federated Search

At Digital Scholarship Unit - UTSC Library, we have developed this module to support search and retrieval using a core that is shared by multiple individual Drupal sites. This allows us to have a federated search across Drupal sites where an end user can conduct a search and see relevant results from multiple sites. Federated Search

Requirements

  • A Solr endpoint
  • A shared Solr core which multisite sites indexing their contents into.
  • Ajax Solr library as dependency library.
  • At /admin/config/search/search-api/index/YOUR_SOLR_INDEX/fields in each of exhibit sites, setup with Search API fields with the same MACHINE NAME and TYPE. For example:
Field Machine Name Type In Solr
Thumbnail thumbnail String ss_thumbnail
Title title Fulltext tm_title
Description description Fulltext tm_description
URI (search_api_url) url String sm_url
Other optional fields to add... ... ... ...

Installation and configuration

  • By Composer: composer require digitalutsc/ajax_solr_search
  • OR git clone this module to your modules directory (ie. web/modules/contrib) of your Drupal site:
    • git clone https://github.com/digitalutsc/drupal_ajax_solr_search.git
  • Clone the dependency Ajax Solr library to Libraries directory (ie. drupal/web/libraries):
    • git clone https://github.com/digitalutsc/ajax-solr.git
  • Enable the module.
  • Visit /admin/config/search/ajax_solr, setting up with:
    • The URL for Search Results Page, default is /federated-search.
    • Select Solr field(s) to search against.
    • Select Solr field(s) for Facets.
    • Select Solr field for Year Range filter.
    • Select Solr field(s) for Sort Criteria.
      • When sorting ascending on a field, results without the field are displayed first. This can be configured by adding sortMissingLast=true to the field in the Solr schema. This property is false by default.
      • Note that sorting on Solr string fields is case-sensitive. Case-insensitive sorting can be done by modifying the Solr schema.
      • Sorting on multivalued fields is not supported.
    • Select 4 mandatory Solr fields for Search Result rows: Thumbnail, title, description, and URL. Other options field can also be added.

Config Screenshot!

Year Range and Sort Criteria Configuration

Additional Config Screenshot!

Usage

Please note:

This module won't work if its Drupal site and Solr Endpoint don't have the same Hypertext Transfer Protocol (HTTP). It means that both of Drupal site and Solr endpoint must be either in https:// or http://.

Maintainers

About

Drupal 8/9 module provide Federated Search with a shared Solr core. It also integrates Ajax Solr library to Drupal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published