From 3333bc7385d16bc0707c5b5a3b9e5a27fac35472 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Thu, 12 Apr 2012 18:10:23 +0200 Subject: [PATCH] Support for approximation --- src/client.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/client.c b/src/client.c index 26dd6ef..f80e302 100644 --- a/src/client.c +++ b/src/client.c @@ -1327,6 +1327,14 @@ Odr_int client_get_hits(struct client *cl) return cl->hits; } +Odr_int client_get_approximation(struct client *cl) +{ + int records = cl->record_offset + cl->filtered; + if (records > 0) + return cl->hits * cl->record_offset / records; + return cl->hits; +} + int client_get_num_records(struct client *cl) { return cl->record_offset; -- 1.7.10.4