[Groonga-commit] groonga/groonga at 4e7371f [master] Report the correct number of results

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Apr 10 16:23:11 JST 2016


Kouhei Sutou	2016-04-10 16:23:11 +0900 (Sun, 10 Apr 2016)

  New Revision: 4e7371fbcfcc4f75c6cd67d3bcdbfa091e3040b2
  https://github.com/groonga/groonga/commit/4e7371fbcfcc4f75c6cd67d3bcdbfa091e3040b2

  Message:
    Report the correct number of results

  Modified files:
    lib/proc/proc_select.c

  Modified: lib/proc/proc_select.c (+11 -2)
===================================================================
--- lib/proc/proc_select.c    2016-04-10 16:20:15 +0900 (37e5a4c)
+++ lib/proc/proc_select.c    2016-04-10 16:23:11 +0900 (f374b3b)
@@ -661,10 +661,19 @@ grn_select_drilldowns_output(grn_ctx *ctx,
                              grn_table_group_result *results)
 {
   unsigned int i;
+  unsigned int n_available_results = 0;
 
-  GRN_OUTPUT_MAP_OPEN("DRILLDOWNS", n_drilldowns);
   for (i = 0; i < n_drilldowns; i++) {
-    drilldown_info *drilldown = &(drilldowns[i]);
+    grn_table_group_result *result = results + i;
+
+    if (result->table) {
+      n_available_results++;
+    }
+  }
+
+  GRN_OUTPUT_MAP_OPEN("DRILLDOWNS", n_available_results);
+  for (i = 0; i < n_drilldowns; i++) {
+    drilldown_info *drilldown = drilldowns + i;
     uint32_t n_hits;
     int offset;
     int limit;
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index