- yaz_log(YLOG_LOG, "search_sort: field=%s increasing=%d must fetch",
- field, increasing);
- sr = nmem_malloc(se->nmem, sizeof(*sr));
- sr->field = nmem_strdup(se->nmem, field);
- sr->increasing = increasing;
- sr->next = se->sorted_results;
- se->sorted_results = sr;
-
+ session_log(se, YLOG_DEBUG, "search_sort: field=%s increasing=%d position=%d must fetch",
+ field, increasing, position);
+ if (position)
+ {
+ yaz_log(YLOG_DEBUG, "Reset results due to position");
+ session_clear_set(se, field, increasing, position);
+ }
+ else {
+ sr = nmem_malloc(se->nmem, sizeof(*sr));
+ sr->field = nmem_strdup(se->nmem, field);
+ sr->increasing = increasing;
+ sr->position = position;
+ sr->next = se->sorted_results;
+ se->sorted_results = sr;
+ }
+ yaz_log(YLOG_DEBUG, "Restarting search for clients due to change in sort order");
+