- int start = ZOOM_options_get_int(options, "start", 0);
- int count = ZOOM_options_get_int(options, "count", 0);
- display_records(c[i], r[i], start, count);
+ display_records(c[i], r[i], start, count, type);
+ }
+ }
+ if (render_str)
+ wrbuf_destroy(render_str);
+
+}
+
+static void display_facets(ZOOM_facet_field *facets, int count) {
+ int index;
+ printf("Facets: \n");
+ for (index = 0; index < count; index++) {
+ int term_index;
+ const char *facet_name = ZOOM_facet_field_name(facets[index]);
+ printf(" %s: \n", facet_name);
+ for (term_index = 0; term_index < ZOOM_facet_field_term_count(facets[index]); term_index++) {
+ int freq = 0;
+ const char *term = ZOOM_facet_field_get_term(facets[index], term_index, &freq);
+ printf(" %s(%d) \n", term, freq);
+ }
+ }
+}
+
+static void cmd_facets(ZOOM_connection *c, ZOOM_resultset *r,
+ ZOOM_options options,
+ const char **args)
+{
+ int i;
+ size_t start = 0, count = 1;
+ const char *type = "render";
+ WRBUF render_str = 0;
+
+ if (0)
+ {
+ WRBUF tmp;
+
+ if ((tmp = next_token_new_wrbuf(args)))
+ {
+ start = atoi(wrbuf_cstr(tmp));
+ wrbuf_destroy(tmp);