X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fsession.c;h=e2eda618fe095995604769961a1bf881ace100a1;hb=91332b13d81ec4e70f547c8b90eabfb7898ea39c;hp=4a817a24a566436f08f3b63e34a6d306a92b0db5;hpb=8961ed761e348e972f00d015284ce75c16b1648c;p=pazpar2-moved-to-github.git diff --git a/src/session.c b/src/session.c index 4a817a2..e2eda61 100644 --- a/src/session.c +++ b/src/session.c @@ -638,6 +638,9 @@ static void session_clear_set(struct session *se, se->sorted_results->position = position; se->sorted_results->next = 0; + session_log(se, YLOG_DEBUG, "clear_set session_sort: field=%s increasing=%d position=%d configured", + sort_field, increasing, position); + se->reclist = reclist_create(se->nmem); } @@ -651,7 +654,6 @@ void session_sort(struct session *se, const char *field, int increasing, yaz_log(YLOG_LOG, "session_sort field=%s increasing=%d position=%d", field, increasing, position); /* see if we already have sorted for this critieria */ - /* TODO I do not see the point in saving all previous sorts. Dont we re-sort anyway ? */ for (sr = se->sorted_results; sr; sr = sr->next) { if (!strcmp(field, sr->field) && increasing == sr->increasing && sr->position == position) @@ -701,8 +703,7 @@ enum pazpar2_error_code session_search(struct session *se, const char *filter, const char *limit, const char **addinfo, - const char *sort_field, - int increasing) + struct reclist_sortparms *sp) { int live_channels = 0; int no_working = 0; @@ -723,7 +724,7 @@ enum pazpar2_error_code session_search(struct session *se, session_enter(se); se->settings_modified = 0; - session_clear_set(se, sort_field, increasing, 0); /* hardcoded position */ + session_clear_set(se, sp->name, sp->increasing, sp->type == Metadata_sortkey_position); relevance_destroy(&se->relevance); live_channels = select_targets(se, filter); @@ -763,6 +764,8 @@ enum pazpar2_error_code session_search(struct session *se, no_failed_query++; else if (parse_ret == -2) no_failed_limit++; + else if (parse_ret) + no_working++; /* other error, such as bad CCL map */ else { int r =