struct setting *idset;
db = nmem_malloc(nmem, sizeof(*db));
- db->url = nmem_strdup(nmem, id);
+ db->id = nmem_strdup(nmem, id);
db->num_settings = PZ_MAX_EOF;
db->settings = nmem_malloc(nmem, sizeof(struct settings*) *
db->num_settings);
idset = nmem_malloc(nmem, sizeof(*idset));
idset->precedence = 0;
idset->name = "pz:id";
- idset->target = idset->value = db->url;
+ idset->target = idset->value = db->id;
idset->next = 0;
db->settings[PZ_ID] = idset;
{
struct database *p;
for (p = service->databases; p; p = p->next)
- if (!strcmp(p->url, id))
+ if (!strcmp(p->id, id))
return p;
p = new_database(id, service->nmem);
if (!rdoc)
{
session_log(se, YLOG_FATAL, "Non-wellformed XML received from %s",
- db->url);
+ db->id);
return 0;
}
if (global_parameters.dump_records)
{
- session_log(se, YLOG_LOG, "Un-normalized record from %s", db->url);
+ session_log(se, YLOG_LOG, "Un-normalized record from %s", db->id);
log_xml_doc(rdoc);
}
if (normalize_record_transform(sdb->map, &rdoc, (const char **)parms))
{
session_log(se, YLOG_WARN, "Normalize failed from %s",
- sdb->database->url);
+ sdb->database->id);
}
else
{
if (global_parameters.dump_records)
{
session_log(se, YLOG_LOG, "Normalized record from %s",
- sdb->database->url);
+ sdb->database->id);
log_xml_doc(rdoc);
}
}
if (!sdb->settings)
{
- session_log(se, YLOG_WARN, "No settings on %s", sdb->database->url);
+ session_log(se, YLOG_WARN, "No settings on %s", sdb->database->id);
return -1;
}
if ((s = session_setting_oneval(sdb, PZ_XSLT)))
if (!sdb->settings)
{
session_log(se, YLOG_WARN,
- "No settings associated with %s", sdb->database->url);
+ "No settings associated with %s", sdb->database->id);
return -1;
}
if (sdb->settings[PZ_XSLT] && !sdb->map)
static void select_targets_callback(struct session *se,
struct session_database *db)
{
- struct client *cl = client_create(db->database->url);
+ struct client *cl = client_create(db->database->id);
struct client_list *l;
- const char *url = session_setting_oneval(db, PZ_URL);
-
- if (!url || !*url)
- url = db->database->url;
client_set_database(cl, db);
struct session_database *sdb;
for (sdb = se->databases; sdb; sdb = sdb->next)
- if (!strcmp(sdb->database->url, id))
+ if (!strcmp(sdb->database->id, id))
return sdb;
return load_session_database(se, id);
}
const char *name = session_setting_oneval(client_get_database(cl),
PZ_NAME);
- res[*count].id = client_get_database(cl)->database->url;
+ res[*count].id = client_get_url(cl);
res[*count].name = *name ? name : "Unknown";
res[*count].hits = client_get_hits(cl);
res[*count].records = client_get_num_records(cl);
if (wrbuf_len(norm_wr) == 0)
{
wrbuf_printf(norm_wr, "%s-%d",
- client_get_database(cl)->database->url, record_no);
+ client_get_url(cl), record_no);
}
if (wrbuf_len(norm_wr) > 0)
mergekey_norm = nmem_strdup(nmem, wrbuf_cstr(norm_wr));
if (!check_record_filter(root, sdb))
{
session_log(se, YLOG_LOG, "Filtered out record no %d from %s",
- record_no, sdb->database->url);
+ record_no, sdb->database->id);
xmlFreeDoc(xdoc);
return -2;
}
return -1;
if (global_parameters.dump_records)
session_log(se, YLOG_LOG, "Cluster id %s from %s (#%d)", cluster->recid,
- sdb->database->url, record_no);
+ sdb->database->id, record_no);
relevance_newrec(se->relevance, cluster);
// now parsing XML record and adding data to cluster or record metadata