From 8b5dc95fe546a6db51a5a599b6004701c8c7ddb0 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 22 Jun 2022 14:42:17 +0000 Subject: [PATCH] Bug 30879: Allow biblionumber as sort option in Elasticsearch Repeat previous tests with Elasticsearch engine You will need to reindex and reset mappings to pickup the changes form the file Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit c8c51867c479bc153d84f9e23cad5983bdd535cb) Signed-off-by: Lucas Gass --- Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 1 + admin/searchengine/elasticsearch/mappings.yaml | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm index 52a53d5dcf..860179ede3 100644 --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -700,6 +700,7 @@ sub _convert_sort_fields { relevance => undef, # default title => 'title', pubdate => 'date-of-publication', + biblionumber => 'local-number', ); my %sort_order_convert = ( qw( desc desc ), qw( dsc desc ), qw( asc asc ), qw( az asc ), qw( za desc ) ); diff --git a/admin/searchengine/elasticsearch/mappings.yaml b/admin/searchengine/elasticsearch/mappings.yaml index 4f40e9b0c8..3eac85f09d 100644 --- a/admin/searchengine/elasticsearch/mappings.yaml +++ b/admin/searchengine/elasticsearch/mappings.yaml @@ -768,14 +768,14 @@ authorities: - facet: '' marc_field: 001 marc_type: marc21 - sort: ~ + sort: 1 suggestible: '' - facet: '' marc_field: 001 marc_type: unimarc - sort: ~ + sort: 1 suggestible: '' - type: string + type: number personal-name: label: personal-name mappings: @@ -2158,14 +2158,14 @@ biblios: - facet: '' marc_field: 999c marc_type: marc21 - sort: 0 + sort: 1 suggestible: '' - facet: '' marc_field: 001 marc_type: unimarc - sort: 0 + sort: 1 suggestible: '' - type: string + type: number location: facet_order: 3 label: location -- 2.39.5