Summary: | Add option to dump built search query to templates | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Architecture, internals, and plumbing | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | 1joynelson, david, ere.maijala, jonathan.druart, kyle, lucas, martin.renvoize, mkstephens |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24110 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This enhancement allows you to view the search query used by Zebra or Elasticsearch, to help with troubleshooting. To use, enable the new system preference DumpSearchQueryTemplate, enable `DumpTemplateVarsIntranet` and `DumpTemplateVarsOpac`, and then search the page source in the staff interface or OPAC for 'search_query'.
**New system preference**: `DumpSearchQueryTemplate` defaults to disabled.
|
Version(s) released in: |
20.05.00, 19.11.05
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 30543 | ||
Attachments: |
Bug 24103: Add option to dump search query to templates
Bug 24103: (follow-up) Dump query on opac authorities search Bug 24103: Add option to dump search query to templates Bug 24103: (follow-up) Dump query on opac authorities search Bug 24103: Add option to dump search query to templates Bug 24103: (follow-up) Dump query on opac authorities search Bug 24103: Add option to dump search query to templates Bug 24103: (follow-up) Dump query on opac authorities search |
Description
Nick Clemens (kidclamp)
2019-11-25 15:02:14 UTC
Created attachment 95792 [details] [review] Bug 24103: Add option to dump search query to templates To test: 1 - Apply patch, update database 2 - Note new syspref 'DumpSearchQueryTemplate' 3 - Leave it off 4 - Enable DumpTemplateVariablesOpac and Staff 5 - Search on staff and opac 6 - View the source 7 - Search for 'search_query' - you shouldn't find it 8 - Enable the new pref 9 - Repeat, but you should find the query 10 - Test staff/opac search and advanced search, cataloguing search, authority search, authfinder search, adding to a basket form a new biblio 11 - All should work and show the query 12 - This will work under both ES and Zebra (In reply to Nick Clemens from comment #1) > Created attachment 95792 [details] [review] [review] > Bug 24103: Add option to dump search query to templates > > To test: > 1 - Apply patch, update database > 2 - Note new syspref 'DumpSearchQueryTemplate' > 3 - Leave it off > 4 - Enable DumpTemplateVariablesOpac and Staff > 5 - Search on staff and opac > 6 - View the source > 7 - Search for 'search_query' - you shouldn't find it > 8 - Enable the new pref > 9 - Repeat, but you should find the query > 10 - Test staff/opac search and advanced search, cataloguing search, > authority search, authfinder search, adding to a basket form a new biblio > 11 - All should work and show the query > 12 - This will work under both ES and Zebra This is very, very close but needs one more thing: it doesn't apply to OPAC authority searches. Test results: 1. Applied patch, updatedatabase, restart_all 2. Noted new syspref 'DumpSearchQueryTemplate' 3. Didn't turn it on 4. Enabled 'DumpTemplateVarsIntranet' and 'DumpTemplateVarsOpac' 5. Searched on staff/intranet, searched on OPAC 6. Viewed the source 7. Searched staff/intranet and OPAC source for 'search_query' - did not find it 8. Enabled 'DumpSearchQueryTemplate' 9. Repeated searches, viewed source, searched source for 'search_query' and found in both staff/intranet source and OPAC source 10-11. Subsequent test searches: a. OPAC advanced search - Yes b. OPAC authority search - NO c. Staff advanced search - Yes d. Cataloguing search - Yes e. Staff authority search - Yes d. Auth_finder search (when editing a biblio) - Yes e. Adding to basket from existing record - Yes 12. Tested with ES only. Plan to retest with both ES and Zebra if patch can be updated to include OPAC authority search. Created attachment 98928 [details] [review] Bug 24103: (follow-up) Dump query on opac authorities search Created attachment 99023 [details] [review] Bug 24103: Add option to dump search query to templates To test: 1 - Apply patch, update database 2 - Note new syspref 'DumpSearchQueryTemplate' 3 - Leave it off 4 - Enable DumpTemplateVariablesOpac and Staff 5 - Search on staff and opac 6 - View the source 7 - Search for 'search_query' - you shouldn't find it 8 - Enable the new pref 9 - Repeat, but you should find the query 10 - Test staff/opac search and advanced search, cataloguing search, authority search, authfinder search, adding to a basket form a new biblio 11 - All should work and show the query 12 - This will work under both ES and Zebra Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 99024 [details] [review] Bug 24103: (follow-up) Dump query on opac authorities search Signed-off-by: Owen Leonard <oleonard@myacpl.org> I tested these under Zebra ONLY, so I don't think I can mark this as signed off. But I wanted to at least give a signoff for Zebra. Created attachment 99054 [details] [review] Bug 24103: Add option to dump search query to templates To test: 1 - Apply the patch, update the database (perl installer/data/mysql/updatedatabase.pl) 2 - Note new system preference 'DumpSearchQueryTemplate' 3 - Leave it off 4 - Enable DumpTemplateVarsIntranet and DumpTemplateVarsOpac system preferences 5 - Search on staff and opac 6 - View the page source 7 - Search for 'search_query' - you shouldn't find it 8 - Enable the new system preference 9 - Repeat steps 5-7, but you should now find the 'search_query' 10 - Test staff/opac search and advanced search, cataloguing search, authority search, authfinder search (/cgi-bin/koha/authorities/auth_finder.pl), adding to a basket form a new biblio 11 - All should work and show the query 12 - This will work under both ES and Zebra Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Nind <david@davidnind.com> Created attachment 99055 [details] [review] Bug 24103: (follow-up) Dump query on opac authorities search Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Nind <david@davidnind.com> Tested on Elastic Search and everything works as per the test plan. To enable Elastic Search on koha-testing-docker: 1) Start up with ku-es6 (instead of just ku) (see the note at bottom of koha-testing-docker README about 'Having Elasticsearch run') 2) Change the search engine from Zebra to Elasticsearch (SearchEngine system preference) 3) Reindex the content: go into the container using kshell then change to the koha directory and run ./misc/search_tools/rebuild_elasticsearch.pl -v -d 4) Search in either the staff interface or OPAC to make sure you get results I'd like it if this was not tied to the other preferences. It makes it hard to work with and not sure if we couldn't just have added to the output without needing a new pref? But working and helpful - passing QA. Created attachment 99137 [details] [review] Bug 24103: Add option to dump search query to templates To test: 1 - Apply patch, update database 2 - Note new syspref 'DumpSearchQueryTemplate' 3 - Leave it off 4 - Enable DumpTemplateVariablesOpac and Staff 5 - Search on staff and opac 6 - View the source 7 - Search for 'search_query' - you shouldn't find it 8 - Enable the new pref 9 - Repeat, but you should find the query 10 - Test staff/opac search and advanced search, cataloguing search, authority search, authfinder search, adding to a basket form a new biblio 11 - All should work and show the query 12 - This will work under both ES and Zebra Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 99138 [details] [review] Bug 24103: (follow-up) Dump query on opac authorities search Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Nice work everyone! Pushed to master for 20.05 enhancement not backported to 19.11.x Backported to 19.11.x branch for 19.11.05 not backporting enhancement to 19.05 |