-/* $Id: extract.c,v 1.142 2003-03-12 17:11:23 pop Exp $
+/* $Id: extract.c,v 1.144 2003-04-15 16:46:18 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
SYSNO *sysno, const char *fname,
struct recordGroup *rGroup, int deleteFlag,
struct file_read_info *fi,
- RecType recType, char *subType, void *clientData)
+ RecType recType, char *subType, void *clientData,
+ int force_update)
{
RecordAttr *recordAttr;
int r;
recordAttr = rec_init_attr (zh->reg->zei, rec);
- if (recordAttr->runNumber ==
+ if (!force_update && recordAttr->runNumber ==
zebraExplain_runNumberIncrement (zh->reg->zei, 0))
{
yaz_log (LOG_LOG, "run number = %d", recordAttr->runNumber);
{
file_begin (fi);
r = recordExtract (zh, sysno, fname, rGroup, deleteFlag, fi,
- recType, subType, clientData);
+ recType, subType, clientData, 1);
} while (r && !sysno && fi->file_more);
file_read_stop (fi);
if (fd != -1)
sysno,
match_criteria,
"<no file>",
- 0));
+ 0,1));
}
/*
If sysno is provided, then it's used to identify the reocord.
int *sysno,
const char *match_criteria,
const char *fname,
- int force_update)
+ int force_update,
+ int allow_update)
{
RecordAttr *recordAttr;
extract_flushRecordKeys (zh, *sysno, 1, &zh->reg->keys);
zh->records_inserted++;
- }
+ }
else
{
/* record already exists */
struct recKeys delkeys;
struct sortKeys sortKeys;
+ if (!allow_update) {
+ logf (LOG_LOG, "skipped %s %s %ld",
+ recordType, fname, (long) recordOffset);
+ logRecord(zh);
+ return -1;
+ }
+
rec = rec_get (zh->reg->records, *sysno);
assert (rec);
}
return bp;
}
+#define OLDENCODE 1
#ifdef OLDENCODE
/* this is the old encode_key_write