The problem was that record where checked for comparison even though
they shouldn't be - in case of cluster merge.
// We found a matching record. Merge them
if (!strcmp(merge_key, mkr->value))
{
// We found a matching record. Merge them
if (!strcmp(merge_key, mkr->value))
{
- for (re = &rb->record->records; *re; re = &(*re)->next)
- 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;
cluster = rb->record;
*re = record;
record->next = 0;
<?xml version="1.0" encoding="UTF-8"?>
<show><status>OK</status>
<activeclients>0</activeclients>
<?xml version="1.0" encoding="UTF-8"?>
<show><status>OK</status>
<activeclients>0</activeclients>
<total>4</total>
<start>0</start>
<total>4</total>
<start>0</start>
<hit>
<md-author>Jack Collins</md-author>
<md-medium>book</md-medium>
<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>
<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>
<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>
<md-date>1995</md-date>
<md-title>How to program a computer vol4</md-title>
</location>
- <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
</hit>
</show>
\ No newline at end of file