= termlist_create(s->nmem, TERMLIST_HIGH_SCORE);
s->num_termlists = i + 1;
}
+ yaz_log(YLOG_DEBUG, "Session: facets for %s: %s (%d)", type, value, count);
+
termlist_insert(s->termlists[i].termlist, value, count);
}
session_watchfun fun;
http_remove_observer(s->watchlist[what].obs);
- fun = s->watchlist[what].fun;
+ fun = s->watchlist[what].fun;
data = s->watchlist[what].data;
/* reset watch before fun is invoked - in case fun wants to set
s->watchlist[what].obs = 0;
session_leave(s);
+ yaz_log(YLOG_DEBUG, "session_alert_watch: %d calling function: %p", what, fun);
fun(data);
}
else
return res;
}
+int session_is_preferred_clients_ready(struct session *s)
+{
+ struct client_list *l;
+ int res = 0;
+
+ for (l = s->clients; l; l = l->next)
+ if (client_is_active_preferred(l->client))
+ res++;
+ yaz_log(YLOG_DEBUG, "%p Session has %d active preferred clients.", s, res);
+ return res == 0;
+}
+
+
enum pazpar2_error_code search(struct session *se,
const char *query,
if (type)
{
size_t len;
- const char *eq = strchr(s, '~');
- if (eq)
- len = eq - s;
+ int substring;
+ const char *eq;
+
+ if ((eq = strchr(s, '=')))
+ substring = 0;
+ else if ((eq = strchr(s, '~')))
+ substring = 1;
+ if (eq)
+ len = eq - s;
else
len = strlen(s);
if (len == strlen((const char *)type) &&
xmlChar *value = xmlNodeGetContent(n);
if (value && *value)
{
- if (!eq || strstr((const char *) value, eq+1))
+ if (!eq ||
+ (substring && strstr((const char *) value, eq+1)) ||
+ (!substring && !strcmp((const char *) value, eq + 1)))
match = 1;
}
xmlFree(value);