X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Fsession.c;h=0d463d6856644a5b5bdc4de2674252e302d7a26e;hb=47468fed198c86bb88662873264bb6f432f101bf;hp=f85a03e243c718b0415aa95a7565f754e48fb003;hpb=07bc8f15f98e22a866adda001ada9010567b3429;p=pazpar2-moved-to-github.git diff --git a/src/session.c b/src/session.c index f85a03e..0d463d6 100644 --- a/src/session.c +++ b/src/session.c @@ -640,8 +640,7 @@ static void session_clear_set(struct session *se, se->reclist = reclist_create(se->nmem); } -void session_sort(struct session *se, const char *field, int increasing, - int clear_set) +void session_sort(struct session *se, const char *field, int increasing, int clear_set) { struct session_sorted_results *sr; struct client_list *l; @@ -649,6 +648,10 @@ void session_sort(struct session *se, const char *field, int increasing, session_enter(se); yaz_log(YLOG_LOG, "session_sort field=%s", field); + // TODO In order for this to work, clear_set may only be true on first call. Every following (poll) may not. + // I do not think we can decide this from the outside of the session. + // The logic should be when we change to/away from a native sort order, + // it should cleared on the first call if (clear_set) { session_clear_set(se, field, increasing);