From: Adam Dickmeiss Date: Fri, 9 Nov 2007 10:43:58 +0000 (+0000) Subject: Deal with ICU not returning sortkey. X-Git-Tag: PAZPAR2.1.0.5~1 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=b35fa8a84e101bd6ab4312611be8460c017a7437;p=pazpar2-moved-to-github.git Deal with ICU not returning sortkey. If pp2_get_sort returns NULL, the display string is used for sort and a warning is issued. This could be a fix for bugs #1858, #1634. But we need to know why a NULL sortkey is returned. --- diff --git a/src/logic.c b/src/logic.c index e2efd06..c7314b2 100644 --- a/src/logic.c +++ b/src/logic.c @@ -1,4 +1,4 @@ -/* $Id: logic.c,v 1.71 2007-10-31 10:22:33 adam Exp $ +/* $Id: logic.c,v 1.72 2007-11-09 10:43:58 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -1266,6 +1266,12 @@ struct record *ingest_record(struct client *cl, Z_External *rec, cluster->sortkeys[sk_field_id]->text.disp = rec_md->data.text.disp; + if (!sort_str) + { + sort_str = rec_md->data.text.disp; + yaz_log(YLOG_WARN, + "Could not make sortkey. Bug #1858"); + } cluster->sortkeys[sk_field_id]->text.sort = nmem_strdup(se->nmem, sort_str); #if 0