projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e81158e
)
Support for approximation
author
Dennis Schafroth
<dennis@indexdata.com>
Thu, 12 Apr 2012 16:10:23 +0000
(18:10 +0200)
committer
Dennis Schafroth
<dennis@indexdata.com>
Thu, 12 Apr 2012 16:10:23 +0000
(18:10 +0200)
src/client.c
patch
|
blob
|
history
diff --git
a/src/client.c
b/src/client.c
index
26dd6ef
..
f80e302
100644
(file)
--- 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;