Reset hits, record_offset later in client_start_search
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 10 Nov 2011 10:13:20 +0000 (11:13 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 10 Nov 2011 10:13:20 +0000 (11:13 +0100)
Because the search may not be executed anyway - if search is already
done and no native sorting is available.

src/client.c

index 4fe301f..5100f80 100644 (file)
@@ -749,8 +749,6 @@ void client_start_search(struct client *cl)
 
     assert(link);
 
-    cl->hits = 0;
-    cl->record_offset = 0;
     cl->diagnostic = 0;
 
     if (extra_args && *extra_args)
@@ -848,6 +846,8 @@ void client_start_search(struct client *cl)
             }
         }
     }
+    cl->hits = 0;
+    cl->record_offset = 0;
     rs = ZOOM_connection_search(link, q);
     ZOOM_query_destroy(q);
     ZOOM_resultset_destroy(cl->resultset);