Bug 11255: allow "relevance ascending" as a sort option
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 15 Nov 2013 10:10:04 +0000 (11:10 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 13 Dec 2013 19:39:25 +0000 (19:39 +0000)
This patch fixes a problem where if a staff member sets the
*defaultSortField/*defaultSortOrder system preferences to relevance
ascending while QueryParser is enabled, default keyword search
would break -- the query parser config did not declare relevance asc
as a possible "modifier".

Note that setting the sort order to relevance ascending does not
actually make catalog search return results with the least relevant
records showing up first; Zebra does not support such a mode.  In other
words, relevance ascending acts exactly the same as relevance descending.

Test plan:

0/ Create some biblio with "history" in the title and
   ensure that the QueryParser system preference is enabled.
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>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
etc/searchengine/queryparser.yaml

index 0cce85c..53cff85 100644 (file)
@@ -1427,6 +1427,12 @@ modifier_mappings:
         2: 102
     enabled: 1
     label: Relevance_dsc
+  relevance_asc:
+    bib1_mapping:
+      biblioserver:
+        2: 102
+    enabled: 1
+    label: Relevance_asc
   title-sort-az:
     bib1_mapping:
       biblioserver: