/* session counting (1) , disable client counting (0) */
static YAZ_MUTEX g_session_mutex = 0;
static int no_sessions = 0;
-static int no_session_total = 0;
static int session_use(int delta)
{
yaz_mutex_create(&g_session_mutex);
yaz_mutex_enter(g_session_mutex);
no_sessions += delta;
- if (delta > 0)
- no_session_total += delta;
sessions = no_sessions;
yaz_mutex_leave(g_session_mutex);
- yaz_log(YLOG_DEBUG, "%s sessions=%d", delta == 0 ? "" : (delta > 0 ? "INC" : "DEC"), no_sessions);
+ yaz_log(YLOG_DEBUG, "%s sessions=%d", delta == 0 ? "" :
+ (delta > 0 ? "INC" : "DEC"), no_sessions);
return sessions;
}
return session_use(0);
}
-int session_count_total(void)
-{
- int total = 0;
- if (!g_session_mutex)
- return 0;
- yaz_mutex_enter(g_session_mutex);
- total = no_session_total;
- yaz_mutex_leave(g_session_mutex);
- return total;
-}
-
static void log_xml_doc(xmlDoc *doc)
{
FILE *lf = yaz_log_file();
session_log(s, YLOG_DEBUG, "Session unlock by %s", caller);
}
-static void session_normalize_facet(struct session *s, const char *type,
- const char *value,
- WRBUF display_wrbuf,
- WRBUF facet_wrbuf)
+static void session_normalize_facet(struct session *s,
+ const char *type, const char *value,
+ WRBUF display_wrbuf, WRBUF facet_wrbuf)
{
struct conf_service *service = s->service;
pp2_charset_token_t prt;
int no_failed_limit = 0;
struct client_list *l, *l0;
+ session_alert_watch(se, SESSION_WATCH_SHOW);
+ session_alert_watch(se, SESSION_WATCH_BYTARGET);
+ session_alert_watch(se, SESSION_WATCH_TERMLIST);
+ session_alert_watch(se, SESSION_WATCH_SHOW_PREF);
+
session_log(se, YLOG_DEBUG, "Search");
*addinfo = 0;
else
return PAZPAR2_NO_TARGETS;
}
- session_log(se, YLOG_LOG, "session_start_search done");
return PAZPAR2_NO_ERROR;
}
session_enter(se, "show_single_start");
*prev_r = 0;
*next_r = 0;
- reclist_limit(se->reclist, se);
+ reclist_limit(se->reclist, se, 1);
reclist_enter(se->reclist);
while ((r = reclist_read_record(se->reclist)))
*sumhits = 0;
*approx_hits = 0;
*total = 0;
- reclist_limit(se->reclist, se);
+ reclist_limit(se->reclist, se, 0);
if (se->relevance)
{
for (spp = sp; spp; spp = spp->next)
rec_md->data.text.disp = p;
rec_md->data.text.sort = 0;
+ rec_md->data.text.snippet = 0;
}
else if (type == Metadata_type_year || type == Metadata_type_date)
{
"for element '%s'", value, type);
continue;
}
+
+ if (ser_md->type == Metadata_type_generic)
+ {
+ WRBUF w = wrbuf_alloc();
+ if (relevance_snippet(se->relevance,
+ (char*) value, ser_md->name, w))
+ rec_md->data.text.snippet = nmem_strdup(se->nmem,
+ wrbuf_cstr(w));
+ wrbuf_destroy(w);
+ }
+
+
wheretoput = &record->metadata[md_field_id];
while (*wheretoput)
wheretoput = &(*wheretoput)->next;
relevance_countwords(se->relevance, cluster,
(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))
{