Bug 14457: Integrate LIBRIS spellchecking
authorEivin Giske Skaaren <eskaaren@yahoo.no>
Mon, 6 Jul 2015 21:46:49 +0000 (21:46 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Tue, 16 Apr 2019 13:17:33 +0000 (13:17 +0000)
commit37970eead1d265b6123f370afd87ac189d4e5e51
treef6f203ac3a022c95960d50c7363b7586a45e8502
parentb74be6724b4b25c73b1e6f22d0ba270b50af755c
Bug 14457: Integrate LIBRIS spellchecking

This patch makes it possible to configure LIBRIS spellchecker as a
"did you mean" feature. When searching for a word or phrase and misspelling
the query will be sent to LIBRIS and if they have a suggestion it will
be shown in the yellow did you mean box in the results page.

The API is not very quick so this type of implementation was chosen to not
disrupt the real-time feeling of the search.

To test:

1. Apply the patch.
2. Go to http://api.libris.kb.se/bibspell/, enter the koha servers IP and click
on the "Generera nyckel" button.
3. Under "Nyckel" you can copy the value that looks like this: E47B44829E265607274B677BC17B8D78,
and enter it into the LibrisKey syspref (cgi-bin/koha/admin/preferences.pl?tab=searching).
4. In cgi-bin/koha/admin/didyoumean.pl check the box for using the LIBRIS API. It is only implemented for OPAC.
5. Perform some searches:
tset - Did you mean should suggest: test
jeg är på smester - suggestion: jag är på semester
dantes inferna - suggestion: dantes inferno

Restored opac-search.pl

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Seems to work, of course I can't tell if it is giving me accurate
suggestions :)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Koha/SuggestionEngine/Plugin/LibrisSpellcheck.pm [new file with mode: 0644]
installer/data/mysql/atomicupdate/bug_14557_add_libriskey_syspref.sql [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/didyoumean.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref