/* This file is part of Pazpar2.
- Copyright (C) 2006-2011 Index Data
+ Copyright (C) 2006-2012 Index Data
Pazpar2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
for (l = se->clients_active; l; l = l->next)
{
struct client *cl = l->client;
- struct timeval tval;
- if (client_prep_connection(cl, se->service->z3950_operation_timeout,
- se->service->z3950_session_timeout,
- se->service->server->iochan_man,
- &tval))
+ if (client_get_state(cl) == Client_Connecting ||
+ client_get_state(cl) == Client_Idle ||
+ client_get_state(cl) == Client_Working)
client_start_search(cl);
}
session_leave(se);
session_log(se, YLOG_LOG, "client REUSE %s", client_get_id(cl));
client_reingest(cl);
}
- else
+ else if (r)
{
session_log(se, YLOG_LOG, "client NEW %s", client_get_id(cl));
client_start_search(cl);
for (j = 0; j < num_names; j++)
{
const char *tname;
-
+ int must_generate_empty = 1; /* bug 5350 */
+
for (i = 0; i < se->num_termlists; i++)
{
tname = se->termlists[i].name;
wrbuf_puts(c->wrbuf, "<list name=\"");
wrbuf_xmlputs(c->wrbuf, tname);
wrbuf_puts(c->wrbuf, "\">\n");
+ must_generate_empty = 0;
p = termlist_highscore(se->termlists[i].termlist, &len);
if (p)
targets_termlist_nb(c->wrbuf, se, num, c->nmem);
wrbuf_puts(c->wrbuf, "</list>\n");
+ must_generate_empty = 0;
+ }
+ if (must_generate_empty)
+ {
+ wrbuf_puts(c->wrbuf, "<list name=\"");
+ wrbuf_xmlputs(c->wrbuf, names[j]);
+ wrbuf_puts(c->wrbuf, "\"/>\n");
}
}
session_leave(se);
struct record_metadata *rec_md = 0;
int md_field_id = -1;
int sk_field_id = -1;
+ int rank = 0;
+ xmlChar *rank_str = 0;
type = xmlGetProp(n, (xmlChar *) "type");
value = xmlNodeListGetString(xdoc, n->children, 1);
continue;
ser_md = &service->metadata[md_field_id];
+
+ rank_str = xmlGetProp(n, (xmlChar *) "rank");
+ if (rank_str)
+ {
+ rank = atoi((const char *) rank_str);
+ xmlFree(rank_str);
+ }
+ else
+ rank = ser_md->rank;
if (ser_md->sortkey_offset >= 0)
{
// ranking of _all_ fields enabled ...
- if (ser_md->rank)
+ if (rank)
+ {
relevance_countwords(se->relevance, cluster,
- (char *) value, ser_md->rank,
- ser_md->name);
+ (char *) value, rank, ser_md->name);
+ }
// construct facets ... unless the client already has reported them
if (ser_md->termlist && !client_has_facet(cl, (char *) type))