Merge branch 'protocol-version2' of ssh://git.indexdata.com/home/git/pub/pazpar2...
authorDennis Schafroth <dennis@indexdata.com>
Fri, 20 Apr 2012 08:50:06 +0000 (10:50 +0200)
committerDennis Schafroth <dennis@indexdata.com>
Fri, 20 Apr 2012 08:50:06 +0000 (10:50 +0200)
src/client.c
src/settings.c

index eee0396..dcbfd6c 100644 (file)
@@ -1328,7 +1328,7 @@ Odr_int client_get_hits(struct client *cl)
 Odr_int client_get_approximation(struct client *cl)
 {
     if (cl->record_offset > 0) {
-        Odr_int approx = (cl->hits * (cl->record_offset - cl->filtered)) / cl->record_offset;
+        Odr_int approx = ((10 * cl->hits * (cl->record_offset - cl->filtered)) / cl->record_offset + 5) /10;
         yaz_log(YLOG_LOG, "%s: Approx: %lld * %d / %d = %lld ", client_get_id(cl), cl->hits, cl->record_offset - cl->filtered, cl->record_offset, approx);
         return approx;
     }
index e7d5b3d..dcd941f 100644 (file)
@@ -505,8 +505,6 @@ static void initialize_hard_settings(struct conf_service *service)
 void initialize_soft_settings(struct conf_service *service)
 {
     int i;
-    yaz_log(YLOG_LOG, "Init soft settings");
-
     for (i = 0; i < service->num_metadata; i++)
     {
         struct conf_metadata *md = &service->metadata[i];
@@ -516,20 +514,22 @@ void initialize_soft_settings(struct conf_service *service)
 
         // Also create setting for some metadata attributes.
         if (md->limitmap) {
-            yaz_log(YLOG_LOG, "Metadata %s has limitmap: %s ",md->name,  md->limitmap);
+            int index; 
             WRBUF wrbuf = wrbuf_alloc();
+            yaz_log(YLOG_DEBUG, "Metadata %s has limitmap: %s ",md->name,  md->limitmap);
             wrbuf_printf(wrbuf, "pz:limitmap:%s", md->name);
-            int index = settings_create_offset(service, wrbuf_cstr(wrbuf));
+            index = settings_create_offset(service, wrbuf_cstr(wrbuf));
             if (index >= 0) {
-                yaz_log(YLOG_LOG, "Service %s default %s=%s",
-                        (service->id ? service->id: "unknown"), wrbuf_cstr(wrbuf), md->limitmap);
                 struct setting new;
+                int offset;
+                yaz_log(YLOG_DEBUG, "Service %s default %s=%s",
+                        (service->id ? service->id: "unknown"), wrbuf_cstr(wrbuf), md->limitmap);
                 new.name = (char *) wrbuf_cstr(wrbuf);
                 new.value = md->limitmap;
                 new.next = 0;
                 new.target = 0;
                 new.precedence = 0;
-                int offset = settings_create_offset(service, new.name);
+                offset = settings_create_offset(service, new.name);
                 update_settings(&new, service->settings, offset, service->nmem);
             }
             wrbuf_destroy(wrbuf);