Bug 25532 - Add a wikipedia-style search suggestion feature to the OPAC
Summary: Add a wikipedia-style search suggestion feature to the OPAC
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: David Roberts
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-18 15:56 UTC by David Roberts
Modified: 2020-06-02 13:59 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 25532: Add a wikipedia-style search suggestion feature to the OPAC (6.18 KB, patch)
2020-05-20 08:35 UTC, David Roberts
Details | Diff | Splinter Review
Bug 25532: Add a wikipedia-style search suggestion feature to the OPAC (6.43 KB, patch)
2020-05-21 15:23 UTC, David Roberts
Details | Diff | Splinter Review
Bug 25532: Add a wikipedia-style search suggestion feature to the OPAC (6.48 KB, patch)
2020-06-02 13:59 UTC, ByWater Sandboxes
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Roberts 2020-05-18 15:56:33 UTC
Some of our (PTFS-E) customer libraries like to have a "Did you mean" feature in the OPAC to help users who mis-spell their search terms. We have developed this using jQuery and Wikipedia, but it would be nice to have this in the core code, behind a system preference for those who don't want it.
Comment 1 David Cook 2020-05-20 02:43:37 UTC
We created a local package for this called Koha::SuggestionEngine::Plugin::CommonMisspellings which our clients use, but I don't think it's designed well enough for master.

I'd be interested in testing out something else though that meets this need.
Comment 2 David Roberts 2020-05-20 08:35:41 UTC
Created attachment 105138 [details] [review]
Bug 25532: Add a wikipedia-style search suggestion feature to the OPAC

This patch adds an auto-complete function to the OPAC search and a new
system preference 'OPACSearchAutoComplete'

To test:

1) Install the patch
2) Go to the OPAC and start typing a search term, e.g. Harry Potter
3) You should see a drop down will appear suggesting likely search terms
which can be selected
4) Repeat the search, but mis-spell your search term, e.g. Hrry Potter.
5) You should still see the correctly spelled search term being offered
for selection
6) Check that the search is unaffected, and still works correctly, both
when logged in and not logged in.
Comment 3 David Roberts 2020-05-20 08:36:53 UTC
(In reply to David Cook from comment #1)
> We created a local package for this called
> Koha::SuggestionEngine::Plugin::CommonMisspellings which our clients use,
> but I don't think it's designed well enough for master.
> 
> I'd be interested in testing out something else though that meets this need.

Thanks David - our customers really like this feature, but obviously it does depend on there being a relevant Wikipedia page in order to be able to correct the spelling, or make a suggestion!
Comment 4 Owen Leonard 2020-05-20 13:37:49 UTC
This is really interesting, and works well. However, I'm concerned about the possibility of confusion on the part of the user.

My assumption is that if a user is familiar with how autocomplete works, they will assume that autocomplete is pulling from a list of existing values. I think it will be confusing for a patron to select from the suggested Wikipedia terms only to find that nothing in the catalog matches.

It's nonsensical to see in the suggestions an entry like "Harry Potter and the Deathly Hallows – Part 1 (disambiguation)."

A partial solution might be to add more explicit labeling to the autocomplete. Something like, "Search terms by Wikipedia" or something like that. I would suggest that the preference be renamed as well to something like "OPACWikipediaSearchSuggestions."
Comment 5 David Roberts 2020-05-20 15:10:33 UTC
(In reply to Owen Leonard from comment #4)
> This is really interesting, and works well. However, I'm concerned about the
> possibility of confusion on the part of the user.
> 
> My assumption is that if a user is familiar with how autocomplete works,
> they will assume that autocomplete is pulling from a list of existing
> values. I think it will be confusing for a patron to select from the
> suggested Wikipedia terms only to find that nothing in the catalog matches.
> 
> It's nonsensical to see in the suggestions an entry like "Harry Potter and
> the Deathly Hallows – Part 1 (disambiguation)."
> 
> A partial solution might be to add more explicit labeling to the
> autocomplete. Something like, "Search terms by Wikipedia" or something like
> that. I would suggest that the preference be renamed as well to something
> like "OPACWikipediaSearchSuggestions."

I'd go along with that - I had trouble thinking what to call this feature when I was writing it! I'll change the naming.
Comment 6 David Cook 2020-05-20 23:32:19 UTC
Ahhh I thought it was a "Did you mean" feature for after you've done a search, but it's a search suggestion before the search is done. Neato. 

I agree with what Owen has said.
Comment 7 David Roberts 2020-05-21 15:23:53 UTC
Created attachment 105220 [details] [review]
Bug 25532: Add a wikipedia-style search suggestion feature to the OPAC

This patch adds an auto-complete function to the OPAC search and a new
system preference 'OPACSearchAutoComplete'

To test:

1) Install the patch
2) Go to the OPAC and start typing a search term, e.g. Harry Potter
3) You should see a drop down will appear suggesting likely search terms
which can be selected
4) Repeat the search, but mis-spell your search term, e.g. Hrry Potter.
5) You should still see the correctly spelled search term being offered
for selection
6) Check that the search is unaffected, and still works correctly, both
when logged in and not logged in.
Comment 8 David Roberts 2020-05-21 15:29:01 UTC
I've implemented the suggestions made so far - you will now see the sys pref has been renamed to OPACWikipediaSearchSuggestions, and you will now see a "Powered by Wikipedia" strap line on the drop down of search suggestions.

I've also just realised that I neglected to suggest in my test plan that you actually switch the feature on! So the test plan is:

1) Install the patch and enable the new OPACWikipediaSearchSuggestions system preference.
2) Go to the OPAC and start typing a search term, e.g. Harry Potter
3) You should see a drop down will appear suggesting likely search terms
which can be selected
4) Repeat the search, but mis-spell your search term, e.g. Hrry Potter.
5) You should still see the correctly spelled search term being offered
for selection
6) Check that the search is unaffected, and still works correctly, both
when logged in and not logged in.
Comment 9 ByWater Sandboxes 2020-06-02 13:59:37 UTC
Created attachment 105488 [details] [review]
Bug 25532: Add a wikipedia-style search suggestion feature to the OPAC

This patch adds an auto-complete function to the OPAC search and a new
system preference 'OPACSearchAutoComplete'

To test:

1) Install the patch
2) Go to the OPAC and start typing a search term, e.g. Harry Potter
3) You should see a drop down will appear suggesting likely search terms
which can be selected
4) Repeat the search, but mis-spell your search term, e.g. Hrry Potter.
5) You should still see the correctly spelled search term being offered
for selection
6) Check that the search is unaffected, and still works correctly, both
when logged in and not logged in.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>