Summary: | sort by relevance asc generates a wrong query | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Searching | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | cbrannon, fridolin.somers, gmcharlt, mathsabypro, sandboxes, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 7674, 10283 | ||
Bug Blocks: | |||
Attachments: |
Bug 11255: allow sorting by relevance asc
Bug 11255: allow sorting by relevance asc Bug 11255: allow sorting by relevance asc |
Description
Jonathan Druart
2013-11-15 10:11:38 UTC
Created attachment 22957 [details] [review] Bug 11255: allow sorting by relevance asc The query parser config does not declare relevance asc as possible "modifier". Test plan: 0/ create some biblio with "history" in the title 1/ define prefs defaultSortField = relevance and defaultSortOrder = asc 2/ search "history" on the staff interface 3/ note that no result is returned. 4/ apply the patch 5/ verify the queryparser config file in use takes the modification into account (see the queryparser_config value in your $KOHA_CONF file). 6/ relaunch the search and verify results are returned By the way, note that all mention of "relevance dsc" in queryparser conf, perl code, sysprefs, and templates should be removed. "Relevance dsc" is a really weird idea. Mathieu Oh, I'm not well wake up. I mean "relevance ASC" is ... is a weird thing. On UX point of view, you never use an opac or even a staff search (except for some testing maybe) and expect to find the least relevant results on the first page. It is useless. Mathieu Yes, it is completely stupid :) But it is possible to set the pref like that, so we should manage with this configuration. In order to get this to work I had to manually copy ~/kohaclone/etc/searchengine/queryparser.yaml to ~/koha-dev/etc/searchengine/queryparser.yaml. Is that to be expected with a git installation? Performing the search after following the test plan results in some results (instead of no results), but the results look the same. No difference in the order. (In reply to Owen Leonard from comment #7) > In order to get this to work I had to manually copy > ~/kohaclone/etc/searchengine/queryparser.yaml to > ~/koha-dev/etc/searchengine/queryparser.yaml. Is that to be expected with a > git installation? I suppose, yes. > Performing the search after following the test plan results in some results > (instead of no results), but the results look the same. No difference in the > order. Yes, it is normal. The relevance is a relation attribute in the zebra query, not a type 7 attribute (using for sort), so I think it is not possible to sort by relevance asc. Patch tested with a sandbox, by Christopher Brannon <cbrannon@cdalibrary.org> Created attachment 23385 [details] [review] Bug 11255: allow sorting by relevance asc The query parser config does not declare relevance asc as possible "modifier". Test plan: 0/ create some biblio with "history" in the title 1/ define prefs defaultSortField = relevance and defaultSortOrder = asc 2/ search "history" on the staff interface 3/ note that no result is returned. 4/ apply the patch 5/ verify the queryparser config file in use takes the modification into account (see the queryparser_config value in your $KOHA_CONF file). 6/ relaunch the search and verify results are returned Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> The patch works as expected, according to the test plan. Christopher Created attachment 23539 [details] [review] Bug 11255: allow sorting by relevance asc The query parser config does not declare relevance asc as possible "modifier". Test plan: 0/ create some biblio with "history" in the title 1/ define prefs defaultSortField = relevance and defaultSortOrder = asc 2/ search "history" on the staff interface 3/ note that no result is returned. 4/ apply the patch 5/ verify the queryparser config file in use takes the modification into account (see the queryparser_config value in your $KOHA_CONF file). 6/ relaunch the search and verify results are returned Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Pushed to master. Thanks, Jonathan! Patch pushed to 3.14.x, will be in 3.14.2 This patch has been pushed to 3.12.x, will be in 3.12.9. Thanks Jonathan! |