s->num_termlists = i + 1;
}
- session_log(s, YLOG_DEBUG, "Session: facets for %s: %s norm:%s (%d)",
+ session_log(s, YLOG_DEBUG, "Facets for %s: %s norm:%s (%d)",
type, value, wrbuf_cstr(facet_wrbuf), count);
termlist_insert(s->termlists[i].termlist, wrbuf_cstr(facet_wrbuf),
count);
session_leave(s);
session_log(s, YLOG_DEBUG,
- "session_alert_watch: %d calling function: %p", what, fun);
+ "Alert Watch: %d calling function: %p", what, fun);
fun(data);
}
else
client_set_database(cl, db);
client_set_session(cl, se);
+
l = xmalloc(sizeof(*l));
l->client = cl;
l->next = se->clients;
for (l = s->clients; l; l = l->next)
if (client_is_active_preferred(l->client))
res++;
- session_log(s, YLOG_DEBUG, "Session has %d active preferred clients.", res);
+ session_log(s, YLOG_DEBUG, "Has %d active preferred clients.", res);
return res == 0;
}
{
struct session_database *sdb;
- session_log(se, YLOG_DEBUG, "Pazpar2 session destroy");
+ session_log(se, YLOG_DEBUG, "Destroying");
session_remove_clients(se);
for (sdb = se->databases; sdb; sdb = sdb->next)
sprintf(tmp_str, "session#%u", session_id);
session->session_id = session_id;
- session_log(session, YLOG_DEBUG, "New session");
+ session_log(session, YLOG_DEBUG, "New");
session->service = service;
session->relevance = 0;
session->total_hits = 0;
struct record_cluster **prev_r,
struct record_cluster **next_r)
{
- struct record_cluster *r;
+ struct record_cluster *r = 0;
session_enter(se);
- reclist_enter(se->reclist);
*prev_r = 0;
*next_r = 0;
- while ((r = reclist_read_record(se->reclist)))
+ if (se->reclist)
{
- if (!strcmp(r->recid, id))
+ reclist_enter(se->reclist);
+ while ((r = reclist_read_record(se->reclist)))
{
- *next_r = reclist_read_record(se->reclist);
- break;
+ if (!strcmp(r->recid, id))
+ {
+ *next_r = reclist_read_record(se->reclist);
+ break;
+ }
+ *prev_r = r;
}
- *prev_r = r;
+ reclist_leave(se->reclist);
}
- reclist_leave(se->reclist);
if (!r)
session_leave(se);
return r;
&se->total_merged);
const char *use_term_factor_str = session_setting_oneval(sdb, PZ_TERMLIST_TERM_FACTOR);
+ // TODO: Work-around to default to use term factor, until other MK2 components supports it
int use_term_factor = 1;
- // HACK: default to use term factor.
int term_factor = 1;
if (use_term_factor_str && use_term_factor_str[0] != 0)
use_term_factor = atoi(use_term_factor_str);
int hits = (int) client_get_hits(cl);
term_factor = MAX(hits, maxrecs) / MAX(1, maxrecs);
assert(term_factor >= 1);
- yaz_log(YLOG_DEBUG, "Using term factor %d ", term_factor);
+ yaz_log(YLOG_DEBUG, "Using term factor: %d (%d / %d)", term_factor, MAX(hits, maxrecs), MAX(1, maxrecs));
}
if (!cluster)
va_start(ap, fmt);
yaz_vsnprintf(buf, sizeof(buf)-30, fmt, ap);
- yaz_log(level, "%u %s", s->session_id, buf);
+ yaz_log(level, "Session (%u): %s", s->session_id, buf);
va_end(ap);
}