- /* see if we already have sorted for this critieria */
- for (sr = se->sorted_results; sr; sr = sr->next)
- {
- if (!strcmp(field, sr->field) && increasing == sr->increasing)
- break;
- }
- if (sr)
- {
- session_log(se, YLOG_DEBUG, "search_sort: field=%s increasing=%d already fetched",
- field, increasing);
- session_leave(se);
- return;
- }
- session_log(se, YLOG_DEBUG, "search_sort: field=%s increasing=%d must fetch",
- field, increasing);
+ session_log(se, YLOG_DEBUG, "search_sort: field=%s increasing=%d position=%d already fetched",
+ field, increasing, position);
+ session_leave(se);
+ return;
+ }
+ 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 {