From: Sebastian Hammer Date: Mon, 15 Jan 2007 20:01:53 +0000 (+0000) Subject: Tuned mergekey normalization X-Git-Tag: stable.27032007~100 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=82b7dfb4f633ed64ddb402d3cd81d391e6a936bc;p=pazpar2-moved-to-github.git Tuned mergekey normalization --- diff --git a/src/pazpar2.c b/src/pazpar2.c index 7e63f47..c24ec00 100644 --- a/src/pazpar2.c +++ b/src/pazpar2.c @@ -1,4 +1,4 @@ -/* $Id: pazpar2.c,v 1.33 2007-01-15 19:17:27 quinn Exp $ */ +/* $Id: pazpar2.c,v 1.34 2007-01-15 20:01:53 quinn Exp $ */ #include #include @@ -319,7 +319,10 @@ char *normalize_mergekey(char *buf, int skiparticle) p++; } if (buf != pout) - *pout = '\0'; + do { + *(pout--) = '\0'; + } + while (pout > buf && *pout == ' '); return buf; } @@ -512,6 +515,7 @@ static struct record *ingest_record(struct client *cl, Z_External *rec) mergekey_norm = nmem_strdup(se->nmem, (char*) mergekey); xmlFree(mergekey); normalize_mergekey(mergekey_norm, 0); + yaz_log(YLOG_LOG, "MK: '%s'", mergekey_norm); cluster = reclist_insert(se->reclist, res, mergekey_norm, &se->total_merged); if (!cluster)