// We found a matching record. Merge them
if (!strcmp(merge_key, mkr->value))
{
- struct record **re;
-
rb = *p;
- for (re = &rb->record->records; *re; re = &(*re)->next)
+ if (!cluster)
{
- if ((*re)->client == record->client &&
- record_compare(record, *re, service))
+ struct record **re;
+ for (re = &rb->record->records; *re; re = &(*re)->next)
{
- yaz_mutex_leave(l->mutex);
- return 0;
+ if ((*re)->client == record->client &&
+ record_compare(record, *re, service))
+ {
+ yaz_mutex_leave(l->mutex);
+ return 0;
+ }
}
- }
-
- if (!cluster)
- {
cluster = rb->record;
*re = record;
record->next = 0;
<?xml version="1.0" encoding="UTF-8"?>
<show><status>OK</status>
<activeclients>0</activeclients>
-<merged>2</merged>
+<merged>1</merged>
<total>4</total>
<start>0</start>
-<num>2</num>
+<num>1</num>
<hit>
<md-author>Jack Collins</md-author>
<md-medium>book</md-medium>
<md-date>1995</md-date>
<md-title>How to program a computer vol4</md-title>
</location>
- <count>3</count>
- <relevance>0</relevance>
- <recid>content: author jack collins medium book title how to program a computer vol1</recid>
-</hit>
-<hit>
- <md-author>Jack Collins</md-author>
- <md-medium>book</md-medium>
- <md-date>1995</md-date>
- <md-title>How to program a computer vol3</md-title>
<location id="localhost:9999"
name="ztest" checksum="1482143625">
<md-author>Jack Collins</md-author>
<md-date>1995</md-date>
<md-title>How to program a computer vol4</md-title>
</location>
- <count>2</count>
+ <count>5</count>
<relevance>0</relevance>
- <recid>content: author jack collins medium book title how to program a computer vol3</recid>
+ <recid>content: author jack collins medium book title how to program a computer vol1</recid>
</hit>
</show>
\ No newline at end of file