Bug ID: 20114
Summary: Build better $query_cgi
Change sponsored?: ---
Priority: P5 - low
Component: Searching - Elasticsearch
Assignee: [hidden email] Reporter: [hidden email]
The current code for building $query_cgi in build_query_compat generates an
invalid query string for many searches (advanced search, clicking a search link
in biblio details etc). When the $query_cgi is incorrect, for example using
pagination results in a search error. Have tried to fix this, and while there
might still be issues, now works considerably better than before.
Build a more complete $query_cgi fixing issues with pagination after
performing either an advanced search or visiting a search link from
1) Go to the details page for a biblio.
2) Click a link that will produce enough hits to trigger pagination.
3) Try going to next page.
4) This will produce a search error.
5) Apply patch.
6) Repeat steps 1 to 3.
7) Pagination should now work as expected.
--- Comment #2 from David Gustafsson <[hidden email]> ---
Discoverd a double-encoding issue, and problem with sort_by being appended
multiple times. So probably best to avoid reviewing this issue until this is
1 - Do a search for"*:*"
2 - Try to limit using a facet
3 - Get a search error
4 - Note the URL says kw=*:*
5 - Apply patch
6 - Repeate search
7 - Facet should work
8 - Note URL is better formed
9 - Test with advanced searches as well
How would you like the solution in the attachment (it is made for older version
of koha so it won't apply)? I.e. completely forego the recreation of search
query. Actually the recreation code is used in just a couple other places
(addbooks.pl, neworderbiblio.pl, opac-search.pl) in Koha so maybe it could be
somehow replaced completely.