From 2ac09752d7cb59ca0501c8666b8bc7a81d1e52d5 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 31 Jan 2014 12:35:59 +0100 Subject: [PATCH] zoomsh: shows SearchResult-1 --- zoom/zoomsh.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) 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"); } -- 1.7.10.4