-/* $Id: extract.c,v 1.129 2002-10-24 21:54:29 adam Exp $
+/* $Id: extract.c,v 1.130 2002-11-07 09:07:07 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
zh->reg->keys.prevAttrSet = -1;
zh->reg->keys.prevSeqNo = 0;
zh->reg->sortKeys.buf_used = 0;
+ zh->reg->sortKeys.buf_max = 0;
+ zh->reg->sortKeys.buf = 0;
extractCtrl.subType = subType;
extractCtrl.init = extract_init;
}
extract_flushSortKeys (zh, *sysno, 1, &zh->reg->sortKeys);
extract_flushRecordKeys (zh, *sysno, 1, &zh->reg->keys);
+
+ zh->records_inserted++;
}
else
{
/* record already exists */
struct recKeys delkeys;
+ struct sortKeys sortKeys;
rec = rec_get (zh->reg->records, *sysno);
assert (rec);
{
logf (LOG_LOG, "skipped %s %s %ld", recordType,
fname, (long) recordOffset);
+ extract_flushSortKeys (zh, *sysno, -1, &zh->reg->sortKeys);
rec_rm (&rec);
+ logRecord(zh);
return 1;
}
delkeys.buf_used = rec->size[recInfo_delKeys];
delkeys.buf = rec->info[recInfo_delKeys];
- extract_flushSortKeys (zh, *sysno, 0, &zh->reg->sortKeys);
+
+ sortKeys.buf_used = rec->size[recInfo_sortKeys];
+ sortKeys.buf = rec->info[recInfo_sortKeys];
+
+ extract_flushSortKeys (zh, *sysno, 0, &sortKeys);
extract_flushRecordKeys (zh, *sysno, 0, &delkeys);
if (delete_flag)
{
{
logf (LOG_LOG, "delete %s %s %ld", recordType,
fname, (long) recordOffset);
+ zh->records_deleted++;
#if 0
if (matchStr)
dict_delete (matchDict, matchStr);
rec_del (zh->reg->records, &rec);
}
rec_rm (&rec);
+ logRecord(zh);
return 1;
}
else
fname, (long) recordOffset);
extract_flushSortKeys (zh, *sysno, 1, &zh->reg->sortKeys);
extract_flushRecordKeys (zh, *sysno, 1, &zh->reg->keys);
+ zh->records_updated++;
}
}
}
rec->size[recInfo_delKeys] = 0;
}
+ /* update sort keys */
+ xfree (rec->info[recInfo_sortKeys]);
+
+ rec->size[recInfo_sortKeys] = zh->reg->sortKeys.buf_used;
+ rec->info[recInfo_sortKeys] = zh->reg->sortKeys.buf;
+ zh->reg->sortKeys.buf = NULL;
+ zh->reg->sortKeys.buf_max = 0;
+
/* save file size of original record */
zebraExplain_recordBytesIncrement (zh->reg->zei,
- recordAttr->recordSize);
/* commit this record */
rec_put (zh->reg->records, &rec);
+ logRecord(zh);
return 0;
}
-/* $Id: zebraapi.c,v 1.76 2002-10-30 14:35:09 adam Exp $
+/* $Id: zebraapi.c,v 1.77 2002-11-07 09:07:07 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
zebra_register_close (zh->service, zh->reg);
zh->reg = 0;
-
yaz_log (LOG_LOG, "Records: %7d i/u/d %d/%d/%d",
zh->records_processed, zh->records_inserted,
zh->records_updated, zh->records_deleted);