}
+// Look up a facet term, and return matching id
+// If facet type not found, returns 0
+// If facet type found, but no matching term, returns ""
const char *session_lookup_id_facet(struct session *s, struct client *cl,
const char *type,
const char *term)
{
+ char *retval = 0;
struct facet_id *t = s->facet_id_list;
- for (; t; t = t->next)
- if (!strcmp(client_get_id(cl), t->client_id) &&
- !strcmp(t->type, type) && !strcmp(t->term, term))
+ for (; t; t = t->next)
+ {
+ if (!strcmp(client_get_id(cl), t->client_id) && !strcmp(t->type, type) )
{
- return t->id;
+ retval = "";
+ if ( !strcmp(t->term, term))
+ {
+ return t->id;
+ }
}
- return 0;
+ }
+ return retval;
}
void add_facet(struct session *s, const char *type, const char *value, int count, struct client *cl)
l->next = se->clients_cached;
se->clients_cached = l;
}
- /* set session always. If may be 0 if client is not active */
client_set_session(cl, se);
l = xmalloc(sizeof(*l));
client_lock(l->client);
client_set_session(l->client, 0);
client_set_database(l->client, 0);
+ client_mark_dead(l->client);
client_unlock(l->client);
client_destroy(l->client);
xfree(l);
*addinfo = "limit";
session_leave(se, "session_search");
se->clients_starting = 0;
+ session_reset_active_clients(se, 0);
return PAZPAR2_MALFORMED_PARAMETER_VALUE;
}