X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=zoom%2Fzoomsh.c;fp=zoom%2Fzoomsh.c;h=2416cfdd98726490cd83e63b86be9c7035ef3432;hp=35b14a00ef07fc7626be4a12b4bbb973d49cb041;hb=2ac09752d7cb59ca0501c8666b8bc7a81d1e52d5;hpb=192c53b56174fa2d80db61029ba95bfa2a1a480a 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"); }