One of the ideas behind authority records is that users who search for one term should have related terms (according to the authority file) suggested to them. At the moment, Koha doesn't do that. Adding an authority searching step to regular searches and displaying any suggestions in a "Did you mean" bar at the top of the results would be very useful.
Created attachment 11151 [details] [review] Bug 8209: "Did you mean?" from authorities One of the ideas behind authority records is that users who search for one term should have related terms (according to the authority file) suggested to them. At the moment, Koha doesn't do that. Adding an authority searching step to regular searches and displaying any suggestions in a "Did you mean" bar at the top of the results would be very useful. This commit adds a Koha::SuggestionEngine class which is in charge of getting suggestions from individual suggestion engine plugins, which much be in the Koha::SuggestionEngine::Plugin::* namespace, and extend Koha::SuggestionEngine::Base. Suggestions are loaded asynchronously using AJAX, and a link to a page with suggestions is provided for users with Javascript turned off. The AuthorityFile suggestion engine plugin looks up the specified search terms in the authority file and then suggests searches for records using matching authorities.
Sorry, Jared: Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all y Applying: Bug 8209: "Did you mean?" from authorities /home/katrin/kohaclone/.git/rebase-apply/patch:834: trailing whitespace. fatal: sha1 information is lacking or useless (C4/AuthoritiesMarc.pm). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 8209: "Did you mean?" from authorities When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".
Created attachment 11292 [details] [review] Bug 8209: "Did you mean?" from authorities One of the ideas behind authority records is that users who search for one term should have related terms (according to the authority file) suggested to them. At the moment, Koha doesn't do that. Adding an authority searching step to regular searches and displaying any suggestions in a "Did you mean" bar at the top of the results would be very useful. This commit adds a Koha::SuggestionEngine class which is in charge of getting suggestions from individual suggestion engine plugins, which much be in the Koha::SuggestionEngine::Plugin::* namespace, and extend Koha::SuggestionEngine::Base. Suggestions are loaded asynchronously using AJAX, and a link to a page with suggestions is provided for users with Javascript turned off. The AuthorityFile suggestion engine plugin looks up the specified search terms in the authority file and then suggests searches for records using matching authorities. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Rebased 2 August 2012
Hi Jared, the new patch applies, a few first findings: 1) Tiny: +our $NAME = 'EmbedItems'; looks suspicious to me. 2) Tiny: The database update message has a tiny typo: Upgrade to 3.09.00.XXX done (Add system preference DidYouMeanFromAuthorities)) 3) Blocker: The suggestions don't show up correctly after activating the feature in system preferences: Did you mean: HASH(0x42a70e0) HASH(0x42a6ed0) HASH(0x429fbd0) HASH(0x429f630) 4) Might be data: I don't get results for the an=[0-9]* searches. I am not sure if this is my database or a general problem, but will wait with testing until 3) is fixed. 5) Suggestion: Use links instead of buttons for display of the suggestions. 6) Tiny: If I have no results for my search and no suggestions are generated, the "Sorry, no suggestions." section covers my "Powered by Koha". The variant for deactivated Javascript works very nicely, except for 3). Sorry to fail QA :( Because Paul pushed so many authority related featured today: I rebased the patch to current master shortly before I started testing. commit 9226ae46419a5c54447c7d6e27b6163d2c6fd95a
Created attachment 11301 [details] [review] Bug 8209: "Did you mean?" from authorities One of the ideas behind authority records is that users who search for one term should have related terms (according to the authority file) suggested to them. At the moment, Koha doesn't do that. Adding an authority searching step to regular searches and displaying any suggestions in a "Did you mean" bar at the top of the results would be very useful. This commit adds a Koha::SuggestionEngine class which is in charge of getting suggestions from individual suggestion engine plugins, which much be in the Koha::SuggestionEngine::Plugin::* namespace, and extend Koha::SuggestionEngine::Base. Suggestions are loaded asynchronously using AJAX, and a link to a page with suggestions is provided for users with Javascript turned off. The AuthorityFile suggestion engine plugin looks up the specified search terms in the authority file and then suggests searches for records using matching authorities. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Rebased 2 August 2012 and incorporated QA feedback
Created attachment 11305 [details] [review] Bug 8209: "Did you mean?" from authorities One of the ideas behind authority records is that users who search for one term should have related terms (according to the authority file) suggested to them. At the moment, Koha doesn't do that. Adding an authority searching step to regular searches and displaying any suggestions in a "Did you mean" bar at the top of the results would be very useful. This commit adds a Koha::SuggestionEngine class which is in charge of getting suggestions from individual suggestion engine plugins, which much be in the Koha::SuggestionEngine::Plugin::* namespace, and extend Koha::SuggestionEngine::Base. Suggestions are loaded asynchronously using AJAX, and a link to a page with suggestions is provided for users with Javascript turned off. The AuthorityFile suggestion engine plugin looks up the specified search terms in the authority file and then suggests searches for records using matching authorities. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Rebased 2 August 2012 and incorporated QA feedback
Created attachment 11321 [details] [review] [SIGNED-OFF] Bug 8209: "Did you mean?" from authorities One of the ideas behind authority records is that users who search for one term should have related terms (according to the authority file) suggested to them. At the moment, Koha doesn't do that. Adding an authority searching step to regular searches and displaying any suggestions in a "Did you mean" bar at the top of the results would be very useful. This commit adds a Koha::SuggestionEngine class which is in charge of getting suggestions from individual suggestion engine plugins, which much be in the Koha::SuggestionEngine::Plugin::* namespace, and extend Koha::SuggestionEngine::Base. Suggestions are loaded asynchronously using AJAX, and a link to a page with suggestions is provided for users with Javascript turned off. The AuthorityFile suggestion engine plugin looks up the specified search terms in the authority file and then suggests searches for records using matching authorities. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Rebased 2 August 2012 and incorporated QA feedback Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Test plan: - Verified database update added system preference correctly, pref defaults to OFF - Verified search results and detail pages in OPAC and staff still worked the same as before * for no results * with results - Activated system preference and tested various searches * Searches from simple search * Searches from advanced search * Search links in records - Deactivated Javascript - verified fallback works correctly Notes: - Suggested terms can include autorities with no linked records. - When combining more than one search option using advanced search this results in "no suggestions" more often. Feature works best from simple search. Overall great feature making use of authorities in a user friendly way!
QA Comment: Code looks good to me. Tested only a bit, refer to signoff. One question: A template block pertaining to koha_spsuggest is removed. This appears dead code to me. But it is in several other templates too. If we remove it here, could we remove it elsewhere too? Perhaps in a followup or under a separate report? Passed QA
(In reply to comment #8) > One question: A template block pertaining to koha_spsuggest is removed. This > appears dead code to me. But it is in several other templates too. If we > remove it here, could we remove it elsewhere too? Perhaps in a followup or > under a separate report? Yes, the spsuggest code is dead. I'll open a new report and submit a patch for it.
Created attachment 12098 [details] [review] Bug 8209: "Did you mean?" from authorities One of the ideas behind authority records is that users who search for one term should have related terms (according to the authority file) suggested to them. At the moment, Koha doesn't do that. Adding an authority searching step to regular searches and displaying any suggestions in a "Did you mean" bar at the top of the results would be very useful. This commit adds a Koha::SuggestionEngine class which is in charge of getting suggestions from individual suggestion engine plugins, which much be in the Koha::SuggestionEngine::Plugin::* namespace, and extend Koha::SuggestionEngine::Base. Suggestions are loaded asynchronously using AJAX, and a link to a page with suggestions is provided for users with Javascript turned off. The AuthorityFile suggestion engine plugin looks up the specified search terms in the authority file and then suggests searches for records using matching authorities. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Rebased 2 August 2012 and incorporated QA feedback Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Test plan: - Verified database update added system preference correctly, pref defaults to OFF - Verified search results and detail pages in OPAC and staff still worked the same as before * for no results * with results - Activated system preference and tested various searches * Searches from simple search * Searches from advanced search * Search links in records - Deactivated Javascript - verified fallback works correctly Notes: - Suggested terms can include autorities with no linked records. - When combining more than one search option using advanced search this results in "no suggestions" more often. Feature works best from simple search. Overall great feature making use of authorities in a user friendly way! Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Rebased on latest master 2012-09-10
Created attachment 12115 [details] [review] SIGNED-OFF-Bug-8209-Did-you-mean-from-authorities. After jcamins rebase for me to apply patch. I needed to retest for 8276.
*** Bug 5705 has been marked as a duplicate of this bug. ***
Patch pushed to master. 1- I love this feature (and it worked out of the box with UNIMARC) 2- I love the way it's coded, with svc,... ++ for adding webservices 3- will require some work to make it work with Solr... (I feel Koha::SuggestionEngine will have to be moved to Koha::SearchEngine::Zebra::Suggestions or something like that, but that will be for later) 4- you continue introducing OOP with Class::Accessor. I'm a little bit uncomfortable having different OOP methods in Koha. We should debate of this later I think (that will be with you as RM, wont start this discussion now ;-) )
Created attachment 12187 [details] [review] Bug 8209 follow-up: fix failing test in AuthorityFile suggestion plugin The BuildSummary output changed slightly, resulting in labels not showing up and a test failing.
follow-up fixes the test errors
Created attachment 12194 [details] [review] Bug 8209 follow-up: another correction for BuildSummary API
(In reply to comment #16) > Created attachment 12194 [details] [review] > Bug 8209 follow-up: another correction for BuildSummary API Status set to "in discussion" ? shouldn't it be "need signoff" ?
Yes, sorry. I got only halfway through the status changing dance.
Created attachment 12217 [details] [review] Bug 8209 follow-up: another correction for BuildSummary API Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
The follow-up is a bugfix, not an enhancement.
(In reply to comment #20) > The follow-up is a bugfix, not an enhancement. Latest followup fixes a display problem. Label was a hash ref instead of a name. Passed QA
Follow-up pushed to master
This feature is available on Master.
*** Bug 8571 has been marked as a duplicate of this bug. ***