-static void yaz_solr_encode_facet_field(ODR encode, char **name, char **value, int *i, Z_FacetField *facet_field, int *limit) {
- Z_AttributeList *attribute_list = facet_field->attributes;
- struct yaz_facet_attr attr_values;
- yaz_facet_attr_init(&attr_values);
- yaz_facet_attr_get_z_attributes(attribute_list, &attr_values);
- // TODO do we want to support server decided
- if (!attr_values.errcode && attr_values.useattr) {
- WRBUF wrbuf = wrbuf_alloc();
- wrbuf_puts(wrbuf, (char *) attr_values.useattr);
- /* Skip date field */
- if (strcmp("date", attr_values.useattr) != 0)
- wrbuf_puts(wrbuf, "_exact");
- 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);
- }
-}
+static int yaz_solr_encode_facet_field(
+ ODR encode, char **name, char **value, int *i,
+ Z_FacetField *facet_field)
+{
+ Z_AttributeList *attribute_list = facet_field->attributes;
+ struct yaz_facet_attr attr_values;
+ yaz_facet_attr_init(&attr_values);
+ yaz_facet_attr_get_z_attributes(attribute_list, &attr_values);
+ // TODO do we want to support server decided