}
else
{
- yaz_log(YLOG_WARN, "Expected record, but got NULL, offset=%d",
- offset);
+ yaz_log(YLOG_WARN, "Expected record, but got NULL, offset=%d", offset);
}
}
const char *opt_preferred = session_setting_oneval(sdb, PZ_PREFERRED);
const char *extra_args = session_setting_oneval(sdb, PZ_EXTRA_ARGS);
const char *opt_present_chunk = session_setting_oneval(sdb, PZ_PRESENT_CHUNK);
- ZOOM_query q;
+ ZOOM_query query;
char maxrecs_str[24], startrecs_str[24], present_chunk_str[24];
int present_chunk = 20; // Default chunk size
if (opt_present_chunk && strcmp(opt_present_chunk,"")) {
/* facets definition is in PQF */
client_set_facets_request(cl, link);
- q = ZOOM_query_create();
+ query = ZOOM_query_create();
if (cl->cqlquery)
{
yaz_log(YLOG_LOG, "Client %s: Search CQL: %s", client_get_id(cl), cl->cqlquery);
- ZOOM_query_cql(q, cl->cqlquery);
+ ZOOM_query_cql(query, cl->cqlquery);
if (*opt_sort)
- ZOOM_query_sortby(q, opt_sort);
+ ZOOM_query_sortby(query, opt_sort);
}
else
{
yaz_log(YLOG_LOG, "Client %s: Search PQF: %s", client_get_id(cl), cl->pquery);
- ZOOM_query_prefix(q, cl->pquery);
+ ZOOM_query_prefix(query, cl->pquery);
}
if (se->sorted_results)
{ /* first entry is current sorting ! */
const char *sort_strategy_and_spec =
- get_strategy_plus_sort(cl, se->sorted_results->field);
+ get_strategy_plus_sort(cl, se->sorted_results->name);
int increasing = se->sorted_results->increasing;
- // int position = se->sorted_results->position;
+ // int position = se->sorted_results->type;
if (sort_strategy_and_spec && strlen(sort_strategy_and_spec) < 40)
{
char spec[50], *p;
else
strcat(p, " >");
yaz_log(YLOG_LOG, "Client %s: applying sorting %s %s", client_get_id(cl), spec, p);
- ZOOM_query_sortby2(q, spec, p);
+ ZOOM_query_sortby2(query, spec, p);
}
}
else
{
- /* no native sorting.. If this is not the first search, then
- skip it entirely */
+ /* no native sorting.. If this is not the first search, then skip it entirely */
if (se->sorted_results->next)
{
+ // TODO this seems wrong. Need to re-ingest instead?
yaz_log(YLOG_DEBUG,"Client %s: Do not (re)search anyway", client_get_id(cl));
- ZOOM_query_destroy(q);
+ ZOOM_query_destroy(query);
return;
}
}
client_set_state(cl, Client_Working);
cl->hits = 0;
cl->record_offset = 0;
- rs = ZOOM_connection_search(link, q);
- ZOOM_query_destroy(q);
+ rs = ZOOM_connection_search(link, query);
+ ZOOM_query_destroy(query);
ZOOM_resultset_destroy(cl->resultset);
cl->resultset = rs;
connection_continue(co);
res = ccl_qual_mk();
for (s = sdb->settings[PZ_CCLMAP]; s; s = s->next)
{
+ const char *addinfo = 0;
char *p = strchr(s->name + 3, ':');
if (!p)
{
- yaz_log(YLOG_WARN, "Malformed cclmap name: %s", s->name);
+ WRBUF w = wrbuf_alloc();
+ wrbuf_printf(w, "Malformed cclmap. name=%s", s->name);
+ yaz_log(YLOG_WARN, "%s: %s", client_get_id(cl), wrbuf_cstr(w));
+ client_set_diagnostic(cl, ZOOM_ERROR_CCL_CONFIG, wrbuf_cstr(w));
+ client_set_state_nb(cl, Client_Error);
ccl_qual_rm(&res);
+ wrbuf_destroy(w);
return 0;
}
p++;
- ccl_qual_fitem(res, s->value, p);
+ if (ccl_qual_fitem2(res, s->value, p, &addinfo))
+ {
+ WRBUF w = wrbuf_alloc();
+
+ wrbuf_printf(w, "Malformed cclmap. name=%s: value=%s (%s)",
+ s->name, p, addinfo);
+ yaz_log(YLOG_WARN, "%s: %s", client_get_id(cl), wrbuf_cstr(w));
+ client_set_diagnostic(cl, ZOOM_ERROR_CCL_CONFIG, wrbuf_cstr(w));
+ client_set_state_nb(cl, Client_Error);
+ ccl_qual_rm(&res);
+ wrbuf_destroy(w);
+ return 0;
+ }
}
return res;
}
Z_RPNQuery *zquery;
if (!ccl_map)
- return -1;
+ return -3;
if (maxrecs && atoi(maxrecs) != cl->maxrecs)
{
nmem_destroy(nmem);
}
+int client_test_sort_order(struct client *cl, struct reclist_sortparms *sp)
+{
+ //TODO implement correctly.
+ return 1;
+}
/*
* Local variables:
* c-basic-offset: 4