X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Freclists.c;h=2ba9b4d9afae8135217d1c7b6cae99204c7338e8;hb=52036cfb58805babf8a80f2f54d1c941c513bac7;hp=b4e2a6dc2ee77510e588008c219547b9c15b628d;hpb=22ae3398d1153b29cdba238f1a5f21e7b3cf35e3;p=pazpar2-moved-to-github.git diff --git a/src/reclists.c b/src/reclists.c index b4e2a6d..2ba9b4d 100644 --- a/src/reclists.c +++ b/src/reclists.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2011 Index Data + Copyright (C) 2006-2012 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -116,6 +116,7 @@ struct reclist_sortparms *reclist_parse_sortparms(NMEM nmem, const char *parms, new->offset = offset; new->type = type; new->increasing = increasing; + new->name = nmem_strdup(nmem, parm); rp = &new->next; if (*(parms = cpp)) parms++; @@ -313,6 +314,17 @@ struct record_cluster *reclist_insert(struct reclist *l, if (!strcmp(merge_key, (*p)->record->merge_key)) { struct record_cluster *existing = (*p)->record; + struct record *re = existing->records; + + for (; re; re = re->next) + { + if (re->client == record->client && + record_compare(record, re, service)) + { + yaz_mutex_leave(l->mutex); + return 0; + } + } record->next = existing->records; existing->records = record; cluster = existing;