void client_search_response(struct client *cl)
{
struct connection *co = cl->connection;
- struct session *se = cl->session;
ZOOM_connection link = connection_get_link(co);
ZOOM_resultset resultset = cl->resultset;
client_report_facets(cl, resultset);
cl->record_offset = cl->startrecs;
cl->hits = ZOOM_resultset_size(resultset);
- if (se) {
- se->total_hits += cl->hits;
- yaz_log(YLOG_DEBUG, "client_search_response: total hits "
- ODR_INT_PRINTF, se->total_hits);
- }
}
}
assert(link);
- cl->hits = -1;
cl->record_offset = 0;
cl->diagnostic = 0;
if (!ccl_map)
return -1;
+ cl->hits = -1;
w_ccl = wrbuf_alloc();
wrbuf_puts(w_ccl, query);
se->reclist = 0;
relevance_destroy(&se->relevance);
nmem_reset(se->nmem);
- se->total_records = se->total_hits = se->total_merged = 0;
+ se->total_records = se->total_merged = 0;
se->num_termlists = 0;
live_channels = select_targets(se, filter);
if (!live_channels)
session_log(session, YLOG_DEBUG, "New");
session->service = service;
session->relevance = 0;
- session->total_hits = 0;
session->total_records = 0;
session->number_of_warnings_unknown_elements = 0;
session->number_of_warnings_unknown_metadata = 0;
}
else
{
+ struct client_list *l;
+
for (spp = sp; spp; spp = spp->next)
if (spp->type == Metadata_sortkey_relevance)
{
reclist_enter(se->reclist);
*total = reclist_get_num_records(se->reclist);
- *sumhits = se->total_hits;
+
+ *sumhits = 0;
+ for (l = se->clients; l; l = l->next)
+ *sumhits += client_get_hits(l->client);
for (i = 0; i < start; i++)
if (!reclist_read_record(se->reclist))
int count = 0;
memset(stat, 0, sizeof(*stat));
+ stat->num_hits = 0;
for (l = se->clients; l; l = l->next)
{
struct client *cl = l->client;
if (!client_get_connection(cl))
stat->num_no_connection++;
+ stat->num_hits += client_get_hits(cl);
switch (client_get_state(cl))
{
case Client_Connecting: stat->num_connecting++; break;
}
count++;
}
- stat->num_hits = se->total_hits;
stat->num_records = se->total_records;
stat->num_clients = count;