From: Adam Dickmeiss Date: Fri, 31 Jan 2014 11:35:59 +0000 (+0100) Subject: zoomsh: shows SearchResult-1 X-Git-Tag: v5.0.13~23 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=2ac09752d7cb59ca0501c8666b8bc7a81d1e52d5 zoomsh: shows SearchResult-1 --- diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index 35b14a0..2416cfd 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -493,6 +493,43 @@ static int cmd_debug(struct zoom_sh *sh, const char **args) return 0; } +static void display_search_result(struct zoom_db *db) +{ + const char *v; + int num; + + v = ZOOM_resultset_option_get(db->res, "searchresult.size"); + if (v && (num = atoi(v))) + { + int i; + printf("SearchResult-1:"); + for (i = 0; i < num; i++) + { + const char *v; + char str[60]; + + if (i) + printf(","); + + sprintf(str, "searchresult.%d.id", i); + v = ZOOM_resultset_option_get(db->res, str); + if (v) + printf(" id=%s", v); + + sprintf(str, "searchresult.%d.subquery.term", i); + v = ZOOM_resultset_option_get(db->res, str); + if (v) + printf(" term=%s", v); + + sprintf(str, "searchresult.%d.count", i); + v = ZOOM_resultset_option_get(db->res, str); + if (v) + printf(" cnt=%s", v); + } + printf("\n"); + } +} + static int cmd_search(struct zoom_sh *sh, const char **args) { ZOOM_query s; @@ -586,6 +623,7 @@ static int cmd_search(struct zoom_sh *sh, const char **args) } } } + display_search_result(db); /* and display */ display_records(db->con, db->res, start, count, "render"); }