projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7dd217c
)
Tuned mergekey normalization
author
Sebastian Hammer
<quinn@indexdata.com>
Mon, 15 Jan 2007 20:01:53 +0000
(20:01 +0000)
committer
Sebastian Hammer
<quinn@indexdata.com>
Mon, 15 Jan 2007 20:01:53 +0000
(20:01 +0000)
src/pazpar2.c
patch
|
blob
|
history
diff --git
a/src/pazpar2.c
b/src/pazpar2.c
index
7e63f47
..
c24ec00
100644
(file)
--- 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 <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
@@
-319,7
+319,10
@@
char *normalize_mergekey(char *buf, int skiparticle)
p++;
}
if (buf != pout)
p++;
}
if (buf != pout)
- *pout = '\0';
+ do {
+ *(pout--) = '\0';
+ }
+ while (pout > buf && *pout == ' ');
return buf;
}
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);
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)
cluster = reclist_insert(se->reclist, res, mergekey_norm, &se->total_merged);
if (!cluster)