- *p++ = '\0'; /* cut the string in two */
- while (*p == ' ')
- p++;
- if (increasing)
- strcat(p, " <");
- else
- strcat(p, " >");
- yaz_log(YLOG_LOG, "applying %s %s", spec, p);
- ZOOM_query_sortby2(q, spec, p);
+ char spec[50], *p;
+ strcpy(spec, sort_strategy_and_spec);
+ p = strchr(spec, ':');
+ if (p)
+ {
+ *p++ = '\0'; /* cut the string in two */
+ while (*p == ' ')
+ p++;
+ if (increasing)
+ strcat(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);
+ }
+ }
+ else
+ {
+ /* no native sorting.. If this is not the first search, then
+ skip it entirely */
+ if (se->sorted_results->next)
+ {
+ yaz_log(YLOG_DEBUG,"Client %s: Do not (re)search anyway", client_get_id(cl));
+ ZOOM_query_destroy(q);
+ return;
+ }