and explainDatabase to facilitate this. Increased maximum number
of databases and attributes in one register.
+Maximum number of databases in one Zebra register increased.
+
+New setting, databasePath, which specifies that first directory
+during update traversal is the database name (instead of
+a fixed one).
+
+New setting, explainDatabase, which specifies that databases
+are EXPLAIN aware.
+
Modified Zebra so that it works with ASN.1 compiled code for YAZ.
Implemented EXPLAIN database maintenance. Zebra automatically
Modified Zebra so that it works with ASN.1 compiled code for YAZ.
Implemented EXPLAIN database maintenance. Zebra automatically
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: extract.c,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: extract.c,v $
- * Revision 1.82 1998-05-20 10:12:15 adam
+ * Revision 1.83 1998-06-08 14:43:10 adam
+ * Added suport for EXPLAIN Proxy servers - added settings databasePath
+ * and explainDatabase to facilitate this. Increased maximum number
+ * of databases and attributes in one register.
+ *
+ * Revision 1.82 1998/05/20 10:12:15 adam
* Implemented automatic EXPLAIN database maintenance.
* Modified Zebra to work with ASN.1 compiled version of YAZ.
*
* Implemented automatic EXPLAIN database maintenance.
* Modified Zebra to work with ASN.1 compiled version of YAZ.
*
if (ch < 0)
ch = zebraExplain_addSU (zti, attrSet, attrUse);
assert (ch > 0);
if (ch < 0)
ch = zebraExplain_addSU (zti, attrSet, attrUse);
assert (ch > 0);
- ((char*) key_buf) [key_buf_used++] = ch;
+ key_buf_used += key_SU_code (ch, ((char*)key_buf) + key_buf_used);
+
while (*src)
((char*)key_buf) [key_buf_used++] = *src++;
src++;
while (*src)
((char*)key_buf) [key_buf_used++] = *src++;
src++;
logf (LOG_DEBUG, "fileExtract %s", fname);
/* determine file extension */
logf (LOG_DEBUG, "fileExtract %s", fname);
/* determine file extension */
for (i = strlen(fname); --i >= 0; )
if (fname[i] == '/')
for (i = strlen(fname); --i >= 0; )
if (fname[i] == '/')
else if (fname[i] == '.')
{
strcpy (ext, fname+i+1);
else if (fname[i] == '.')
{
strcpy (ext, fname+i+1);
if (!(rGroup->recordType = res_get (common_resource, ext_res)))
{
sprintf (ext_res, "%srecordType", gprefix);
if (!(rGroup->recordType = res_get (common_resource, ext_res)))
{
sprintf (ext_res, "%srecordType", gprefix);
- if (!(rGroup->recordType = res_get (common_resource, ext_res)))
- {
- if (records_processed < rGroup->fileVerboseLimit)
- logf (LOG_LOG, "? %s", fname);
- return 0;
- }
+ rGroup->recordType = res_get (common_resource, ext_res);
}
}
if (!rGroup->recordType)
{
if (records_processed < rGroup->fileVerboseLimit)
}
}
if (!rGroup->recordType)
{
if (records_processed < rGroup->fileVerboseLimit)
- logf (LOG_LOG, "? record %s", fname);
+ logf (LOG_LOG, "? %s", fname);
+ if (!*rGroup->recordType)
+ return 0;
if (!(recType = recType_byName (rGroup->recordType, subType)))
{
logf (LOG_WARN, "No such record type: %s", rGroup->recordType);
if (!(recType = recType_byName (rGroup->recordType, subType)))
{
logf (LOG_WARN, "No such record type: %s", rGroup->recordType);
if (!rGroup->databaseName)
rGroup->databaseName = "Default";
if (!rGroup->databaseName)
rGroup->databaseName = "Default";
+ /* determine if explain database */
+
+ sprintf (ext_res, "%sexplainDatabase", gprefix);
+ rGroup->explainDatabase =
+ atoi (res_get_def (common_resource, ext_res, "0"));
+
+ /* announce database */
if (zebraExplain_curDatabase (zti, rGroup->databaseName))
{
if (zebraExplain_curDatabase (zti, rGroup->databaseName))
{
- if (zebraExplain_newDatabase (zti, rGroup->databaseName))
+ if (zebraExplain_newDatabase (zti, rGroup->databaseName,
+ rGroup->explainDatabase))
if (zebraExplain_curDatabase (zti, rec->info[recInfo_databaseName]))
{
if (zebraExplain_curDatabase (zti, rec->info[recInfo_databaseName]))
{
- if (zebraExplain_newDatabase (zti, rec->info[recInfo_databaseName]))
+ if (zebraExplain_newDatabase (zti, rec->info[recInfo_databaseName], 0))
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: index.h,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: index.h,v $
- * Revision 1.58 1998-05-20 10:12:16 adam
+ * Revision 1.59 1998-06-08 14:43:11 adam
+ * Added suport for EXPLAIN Proxy servers - added settings databasePath
+ * and explainDatabase to facilitate this. Increased maximum number
+ * of databases and attributes in one register.
+ *
+ * Revision 1.58 1998/05/20 10:12:16 adam
* Implemented automatic EXPLAIN database maintenance.
* Modified Zebra to work with ASN.1 compiled version of YAZ.
*
* Implemented automatic EXPLAIN database maintenance.
* Modified Zebra to work with ASN.1 compiled version of YAZ.
*
int flagStoreKeys;
int flagRw;
int fileVerboseLimit;
int flagStoreKeys;
int flagRw;
int fileVerboseLimit;
+ int databaseNamePath;
+ int explainDatabase;
data1_handle dh;
BFiles bfs;
ZebraMaps zebra_maps;
data1_handle dh;
BFiles bfs;
ZebraMaps zebra_maps;
void key_input (BFiles bfs, int nkeys, int cache);
ISAMC_M key_isamc_m (Res res);
int merge_sort (char **buf, int from, int to);
void key_input (BFiles bfs, int nkeys, int cache);
ISAMC_M key_isamc_m (Res res);
int merge_sort (char **buf, int from, int to);
+int key_SU_code (int ch, char *out);
#define FNAME_DICT "dict"
#define FNAME_ISAM "isam"
#define FNAME_DICT "dict"
#define FNAME_ISAM "isam"
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: kcompare.c,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: kcompare.c,v $
- * Revision 1.23 1998-03-05 08:45:12 adam
+ * Revision 1.24 1998-06-08 14:43:12 adam
+ * Added suport for EXPLAIN Proxy servers - added settings databasePath
+ * and explainDatabase to facilitate this. Increased maximum number
+ * of databases and attributes in one register.
+ *
+ * Revision 1.23 1998/03/05 08:45:12 adam
* New result set model and modular ranking system. Moved towards
* descent server API. System information stored as "SGML" records.
*
* New result set model and modular ranking system. Moved towards
* descent server API. System information stored as "SGML" records.
*
+int key_SU_code (int ch, char *out)
+{
+ int i;
+ logf (LOG_LOG, "key_SU_code: %d", ch);
+ for (i = 0; ch; i++)
+ {
+ if (ch > 63)
+ out[i] = 128 + (ch & 63);
+ else
+ out[i] = 1 + ch;
+ logf (LOG_LOG, " %d", out[i]);
+ ch = ch >> 6;
+ }
+ return i;
+}
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: main.c,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: main.c,v $
- * Revision 1.57 1998-05-20 10:12:18 adam
+ * Revision 1.58 1998-06-08 14:43:13 adam
+ * Added suport for EXPLAIN Proxy servers - added settings databasePath
+ * and explainDatabase to facilitate this. Increased maximum number
+ * of databases and attributes in one register.
+ *
+ * Revision 1.57 1998/05/20 10:12:18 adam
* Implemented automatic EXPLAIN database maintenance.
* Modified Zebra to work with ASN.1 compiled version of YAZ.
*
* Implemented automatic EXPLAIN database maintenance.
* Modified Zebra to work with ASN.1 compiled version of YAZ.
*
rGroupDef.flagStoreData = -1;
rGroupDef.flagStoreKeys = -1;
rGroupDef.flagRw = 1;
rGroupDef.flagStoreData = -1;
rGroupDef.flagStoreKeys = -1;
rGroupDef.flagRw = 1;
+ rGroupDef.databaseNamePath = 0;
+ rGroupDef.explainDatabase = 0;
rGroupDef.fileVerboseLimit = 100000;
rGroupDef.zebra_maps = NULL;
rGroupDef.dh = data1_create ();
rGroupDef.fileVerboseLimit = 100000;
rGroupDef.zebra_maps = NULL;
rGroupDef.dh = data1_create ();
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: trav.c,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: trav.c,v $
- * Revision 1.33 1998-01-12 15:04:08 adam
+ * Revision 1.34 1998-06-08 14:43:14 adam
+ * Added suport for EXPLAIN Proxy servers - added settings databasePath
+ * and explainDatabase to facilitate this. Increased maximum number
+ * of databases and attributes in one register.
+ *
+ * Revision 1.33 1998/01/12 15:04:08 adam
* The test option (-s) only uses read-lock (and not write lock).
*
* Revision 1.32 1997/09/25 14:56:51 adam
* The test option (-s) only uses read-lock (and not write lock).
*
* Revision 1.32 1997/09/25 14:56:51 adam
}
static void repositoryExtractR (int deleteFlag, char *rep,
}
static void repositoryExtractR (int deleteFlag, char *rep,
- struct recordGroup *rGroup)
+ struct recordGroup *rGroup,
+ int level)
{
struct dir_entry *e;
int i;
{
struct dir_entry *e;
int i;
rep[rep_len] = '/';
else
--rep_len;
rep[rep_len] = '/';
else
--rep_len;
for (i=0; e[i].name; i++)
{
for (i=0; e[i].name; i++)
{
strcpy (rep +rep_len+1, e[i].name);
strcpy (rep +rep_len+1, e[i].name);
+ if ((ecp = strrchr (e[i].name, '/')))
+ *ecp = '\0';
+ if (level == 0 && rGroup->databaseNamePath)
+ rGroup->databaseName = e[i].name;
+
switch (e[i].kind)
{
case dirs_file:
fileExtract (NULL, rep, rGroup, deleteFlag);
break;
case dirs_dir:
switch (e[i].kind)
{
case dirs_file:
fileExtract (NULL, rep, rGroup, deleteFlag);
break;
case dirs_dir:
- repositoryExtractR (deleteFlag, rep, rGroup);
+ repositoryExtractR (deleteFlag, rep, rGroup, level+1);
}
static void fileUpdateR (struct dirs_info *di, struct dirs_entry *dst,
}
static void fileUpdateR (struct dirs_info *di, struct dirs_entry *dst,
- const char *base, char *src,
- struct recordGroup *rGroup)
+ const char *base, char *src,
+ struct recordGroup *rGroup,
+ int level)
{
struct dir_entry *e_src;
int i_src = 0;
{
struct dir_entry *e_src;
int i_src = 0;
else
break;
logf (LOG_DEBUG, "trav sd=%d", sd);
else
break;
logf (LOG_DEBUG, "trav sd=%d", sd);
+
+ if (level == 0 && rGroup->databaseNamePath)
+ rGroup->databaseName = e_src[i_src].name;
if (sd == 0)
{
strcpy (src + src_len, e_src[i_src].name);
if (sd == 0)
{
strcpy (src + src_len, e_src[i_src].name);
dst = dirs_read (di);
break;
case dirs_dir:
dst = dirs_read (di);
break;
case dirs_dir:
- fileUpdateR (di, dst, base, src, rGroup);
+ fileUpdateR (di, dst, base, src, rGroup, level+1);
dst = dirs_last (di);
logf (LOG_DEBUG, "last is %s", dst ? dst->path : "null");
break;
dst = dirs_last (di);
logf (LOG_DEBUG, "last is %s", dst ? dst->path : "null");
break;
dirs_add (di, src, sysno, e_src[i_src].mtime);
break;
case dirs_dir:
dirs_add (di, src, sysno, e_src[i_src].mtime);
break;
case dirs_dir:
- fileUpdateR (di, dst, base, src, rGroup);
+ fileUpdateR (di, dst, base, src, rGroup, level+1);
if (dst)
dst = dirs_last (di);
break;
if (dst)
dst = dirs_last (di);
break;
sprintf (resStr, "%srecordId", gPrefix);
rGroup->recordId = res_get (common_resource, resStr);
sprintf (resStr, "%srecordId", gPrefix);
rGroup->recordId = res_get (common_resource, resStr);
+ sprintf (resStr, "%sdatabasePath", gPrefix);
+ rGroup->databaseNamePath =
+ atoi (res_get_def (common_resource, resStr, "0"));
}
void repositoryShow (struct recordGroup *rGroup)
}
void repositoryShow (struct recordGroup *rGroup)
}
di = dirs_open (dict, src, rGroup->flagRw);
*dst = '\0';
}
di = dirs_open (dict, src, rGroup->flagRw);
*dst = '\0';
- fileUpdateR (di, dirs_read (di), src, dst, rGroup);
+ fileUpdateR (di, dirs_read (di), src, dst, rGroup, 0);
if (S_ISREG(sbuf.st_mode))
fileExtract (NULL, src, rGroup, deleteFlag);
else if (S_ISDIR(sbuf.st_mode))
if (S_ISREG(sbuf.st_mode))
fileExtract (NULL, src, rGroup, deleteFlag);
else if (S_ISDIR(sbuf.st_mode))
- repositoryExtractR (deleteFlag, src, rGroup);
+ repositoryExtractR (deleteFlag, src, rGroup, 0);
else
logf (LOG_WARN, "Ignoring path %s", src);
}
else
logf (LOG_WARN, "Ignoring path %s", src);
}
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zinfo.c,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zinfo.c,v $
- * Revision 1.9 1998-06-02 12:10:27 adam
+ * Revision 1.10 1998-06-08 14:43:15 adam
+ * Added suport for EXPLAIN Proxy servers - added settings databasePath
+ * and explainDatabase to facilitate this. Increased maximum number
+ * of databases and attributes in one register.
+ *
+ * Revision 1.9 1998/06/02 12:10:27 adam
* Fixed bug related to attributeDetails.
*
* Revision 1.8 1998/05/20 10:12:20 adam
* Fixed bug related to attributeDetails.
*
* Revision 1.8 1998/05/20 10:12:20 adam
}
*zdip = NULL;
rec_rm (&trec);
}
*zdip = NULL;
rec_rm (&trec);
- zebraExplain_newDatabase (zei, "IR-Explain-1");
+ zebraExplain_newDatabase (zei, "IR-Explain-1", 0);
-int zebraExplain_newDatabase (ZebraExplainInfo zei, const char *database)
+int zebraExplain_newDatabase (ZebraExplainInfo zei, const char *database,
+ int explain_database)
{
struct zebDatabaseInfoB *zdi;
data1_node *node_dbinfo, *node_adinfo;
{
struct zebDatabaseInfoB *zdi;
data1_node *node_dbinfo, *node_adinfo;
data1_add_tagdata_text (zei->dh, node_dbinfo, "name",
database, zei->nmem);
data1_add_tagdata_text (zei->dh, node_dbinfo, "name",
database, zei->nmem);
+
+ if (explain_database)
+ data1_add_tagdata_text (zei->dh, node_dbinfo, "explainDatabase",
+ "", zei->nmem);
+
data1_add_tagdata_text (zei->dh, node_dbinfo, "userFee",
data1_add_tagdata_text (zei->dh, node_dbinfo, "userFee",
data1_add_tagdata_text (zei->dh, node_dbinfo, "available",
data1_add_tagdata_text (zei->dh, node_dbinfo, "available",
#if ZINFO_DEBUG
data1_pr_tree (zei->dh, zdi->data1_database, stderr);
#endif
#if ZINFO_DEBUG
data1_pr_tree (zei->dh, zdi->data1_database, stderr);
#endif
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zinfo.h,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zinfo.h,v $
- * Revision 1.4 1998-05-20 10:12:21 adam
+ * Revision 1.5 1998-06-08 14:43:16 adam
+ * Added suport for EXPLAIN Proxy servers - added settings databasePath
+ * and explainDatabase to facilitate this. Increased maximum number
+ * of databases and attributes in one register.
+ *
+ * Revision 1.4 1998/05/20 10:12:21 adam
* Implemented automatic EXPLAIN database maintenance.
* Modified Zebra to work with ASN.1 compiled version of YAZ.
*
* Implemented automatic EXPLAIN database maintenance.
* Modified Zebra to work with ASN.1 compiled version of YAZ.
*
void zebraExplain_close (ZebraExplainInfo zei, int writeFlag,
int (*updateH)(Record drec, data1_node *n));
int zebraExplain_curDatabase (ZebraExplainInfo zei, const char *database);
void zebraExplain_close (ZebraExplainInfo zei, int writeFlag,
int (*updateH)(Record drec, data1_node *n));
int zebraExplain_curDatabase (ZebraExplainInfo zei, const char *database);
-int zebraExplain_newDatabase (ZebraExplainInfo zei, const char *database);
+int zebraExplain_newDatabase (ZebraExplainInfo zei, const char *database,
+ int explain_database);
int zebraExplain_lookupSU (ZebraExplainInfo zei, int set, int use);
int zebraExplain_addSU (ZebraExplainInfo zei, int set, int use);
void zebraExplain_addSchema (ZebraExplainInfo zei, Odr_oid *oid);
int zebraExplain_lookupSU (ZebraExplainInfo zei, int set, int use);
int zebraExplain_addSU (ZebraExplainInfo zei, int set, int use);
void zebraExplain_addSchema (ZebraExplainInfo zei, Odr_oid *oid);
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zrpn.c,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zrpn.c,v $
- * Revision 1.77 1998-05-20 10:12:22 adam
+ * Revision 1.78 1998-06-08 14:43:17 adam
+ * Added suport for EXPLAIN Proxy servers - added settings databasePath
+ * and explainDatabase to facilitate this. Increased maximum number
+ * of databases and attributes in one register.
+ *
+ * Revision 1.77 1998/05/20 10:12:22 adam
* Implemented automatic EXPLAIN database maintenance.
* Modified Zebra to work with ASN.1 compiled version of YAZ.
*
* Implemented automatic EXPLAIN database maintenance.
* Modified Zebra to work with ASN.1 compiled version of YAZ.
*
assert (*info == sizeof(*p->isam_p_buf));
memcpy (p->isam_p_buf + p->isam_p_indx, info+1, sizeof(*p->isam_p_buf));
assert (*info == sizeof(*p->isam_p_buf));
memcpy (p->isam_p_buf + p->isam_p_indx, info+1, sizeof(*p->isam_p_buf));
term_untrans (p->zh, p->reg_type, term_tmp, name+2);
logf (LOG_DEBUG, "grep: %s", term_tmp);
term_untrans (p->zh, p->reg_type, term_tmp, name+2);
logf (LOG_DEBUG, "grep: %s", term_tmp);
local_attr = local_attr->next)
{
int ord;
local_attr = local_attr->next)
{
int ord;
+ char ord_buf[32];
+ int i, ord_len;
ord = zebraExplain_lookupSU (zh->zei, attp.attset_ordinal,
local_attr->local);
ord = zebraExplain_lookupSU (zh->zei, attp.attset_ordinal,
local_attr->local);
term_dict[prefix_len++] = '|';
else
term_dict[prefix_len++] = '(';
term_dict[prefix_len++] = '|';
else
term_dict[prefix_len++] = '(';
- term_dict[prefix_len++] = 1;
- term_dict[prefix_len++] = ord;
+
+ ord_len = key_SU_code (ord, ord_buf);
+ for (i = 0; i<ord_len; i++)
+ {
+ term_dict[prefix_len++] = 1;
+ term_dict[prefix_len++] = ord_buf[i];
+ }
sizeof(*scan_info->list));
for (j = 0; j<before+after; j++)
scan_info->list[j].term = NULL;
sizeof(*scan_info->list));
for (j = 0; j<before+after; j++)
scan_info->list[j].term = NULL;
- termz[prefix_len++] = ords[i];
+
+ prefix_len += key_SU_code (ords[i], termz + prefix_len);
termz[prefix_len++] = reg_id;
termz[prefix_len] = 0;
strcpy (scan_info->prefix, termz);
termz[prefix_len++] = reg_id;
termz[prefix_len] = 0;
strcpy (scan_info->prefix, termz);
# Simple Zebra configuration file that defines
# a database with USMARC records.
# Simple Zebra configuration file that defines
# a database with USMARC records.
-# $Id: zebra.cfg,v 1.2 1998-05-20 10:12:30 adam Exp $
+# $Id: zebra.cfg,v 1.3 1998-06-08 14:43:18 adam Exp $
#
# Where are the YAZ / Zebra tables located?
profilePath: .:../../tab:../../../yaz/tab
#
# Where are the YAZ / Zebra tables located?
profilePath: .:../../tab:../../../yaz/tab
# Approx. Memory usage during indexing
memMax: 4
# Approx. Memory usage during indexing
memMax: 4
+# Shadow Area
+shadow: shadow:100M
+