-static void yaz_solr_encode_facet_list(ODR encode, char **name, char **value, int *i, Z_FacetList *facet_list, int *limit) {
+ if (attr_values.errcode)
+ return -1;
+ if (attr_values.useattr)
+ {
+ WRBUF wrbuf = wrbuf_alloc();
+ wrbuf_puts(wrbuf, (char *) attr_values.useattr);
+ yaz_add_name_value_str(encode, name, value, i,
+ "facet.field",
+ odr_strdup(encode, wrbuf_cstr(wrbuf)));
+ if (attr_values.limit > 0)
+ {
+ WRBUF wrbuf2 = wrbuf_alloc();
+ Odr_int olimit;
+ wrbuf_puts(wrbuf2, "f.");
+ wrbuf_puts(wrbuf2, wrbuf_cstr(wrbuf));
+ wrbuf_puts(wrbuf2, ".facet.limit");
+ olimit = attr_values.limit;
+ yaz_add_name_value_int(encode, name, value, i,
+ odr_strdup(encode, wrbuf_cstr(wrbuf2)),
+ &olimit);
+ wrbuf_destroy(wrbuf2);
+ }
+ wrbuf_destroy(wrbuf);
+ }
+ return 0;
+}