os2web/os2web_search

Search functionality powered by SOLR

Installs: 1 496

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 9

Forks: 0

Open Issues: 0

Type:drupal-module

dev-master 2023-02-08 10:43 UTC

This package is auto-updated.

Last update: 2024-12-06 14:24:54 UTC


README

//TODO:

  1. Can only be installed when EN and DA are present
  2. required search_api_attachments
  3. change index mode (search index)

OS2Web Search Drupal module Build Status

Module purpose

The aim of this module is to provide search functionality powered by SOLR.

How does it work

After enabling search is available on the search page, as well as exposed form is added to 4 regions: Megamenu - search, Header - search, Header - below (front page only), Content (search page only).

Search page: /s

Install

  1. Create the SOLR core. Read manual.

  2. Make sure you have both english and danish language in your installation /admin/config/regional/language.

  3. Module is available to download via composer.

    composer require os2web/os2web_search
    drush en os2web_search
    
  4. After activation finish the set up here: admin/config/search/search-api/server/os2web_search_server/edit

    The following fields need to be manually inserted:

    • Solr host
    • Solr core

Update

Updating process for OS2Web Nemlogin module is similar to usual Drupal 8 module. Use Composer's built-in command for listing packages that have updates available:

composer outdated os2web/os2web_search

Synonyms activation

In order to use search synonyms for search those actions need to be done:

  1. Enable synonyms module:

    drush en search_api_synonym
    
  2. Add some synonyms: admin/config/search/search-api-synonyms

  3. Make sure your cron is running

  4. Copy the script os2web_search/scripts/synonyms_deploy.sh.example into any directory outside Drupal and execute it each time right after the cron.

    Script requires those variables to be set:

    • synonymdir=[path to synonyms]

      Full path to synonyms export folder location e.g. /var/www/os2web.dk/web/sites/default/files/synonyms/

    • solrconfig=[path to SOLR core configuration]

      Full path to SOLR core config folder e.g. /opt/solr/server/solr/sik/conf/

    • [SOLR Core]

      SOLR Core name

The script will work in the following way:

  • It checks the synonyms export location
  • If it has some files (matching the pattern), those files are moved to SOLR config location and renamed
  • After that the SOLR core is reloaded so that synonyms are active

Module translation

Module's main language is English but Danish language is fully supported.

When extending this module add your translations to the corresponding *.po files located modules/contrib/os2web_search/translations/ and run the following to update translations:

drush locale-check
drush locale-update && drush cr

Automated testing and code quality

See OS2Web testing and CI information

Contribution

Project is opened for new features and os course bugfixes. If you have any suggestion or you found a bug in project, you are very welcome to create an issue in github repository issue tracker. For issue description there is expected that you will provide clear and sufficient information about your feature request or bug report.

Code review policy

See OS2Web code review policy

Git name convention

See OS2Web git name convention