as opposed to request.
r->connection = 0;
r->databaseNames = 0;
r->num_databaseNames = 0;
- r->facets = 0;
- r->num_facets = 0;
+ r->res_facets = 0;
+ r->num_res_facets = 0;
r->facets_names = 0;
r->mutex = 0;
yaz_mutex_create(&r->mutex);
ZOOM_API(size_t)
ZOOM_resultset_facets_size(ZOOM_resultset r)
{
- return r->num_facets;
+ return r->num_res_facets;
}
ZOOM_API(ZOOM_facet_field)
ZOOM_resultset_get_facet_field(ZOOM_resultset r, const char *name)
{
- int num = r->num_facets;
- ZOOM_facet_field *facets = r->facets;
+ int num = r->num_res_facets;
+ ZOOM_facet_field *facets = r->res_facets;
int i;
for (i = 0; i < num; i++)
if (!strcmp(facets[i]->facet_name, name))
ZOOM_API(ZOOM_facet_field)
ZOOM_resultset_get_facet_field_by_index(ZOOM_resultset r, int idx)
{
- int num = r->num_facets;
- ZOOM_facet_field *facets = r->facets;
+ int num = r->num_res_facets;
+ ZOOM_facet_field *facets = r->res_facets;
if (idx >= 0 && idx < num)
return facets[idx];
return 0;
ZOOM_API(ZOOM_facet_field *)
ZOOM_resultset_facets(ZOOM_resultset r)
{
- return r->facets;
+ return r->res_facets;
}
ZOOM_API(const char**)
struct WRBUF_shptr *record_wrbuf;
#endif
ZOOM_resultset next;
- ZOOM_facet_field *facets;
- int num_facets;
+ ZOOM_facet_field *res_facets;
+ int num_res_facets;
char **facets_names; /* redundant. For ZOOM_resultset_facets_names only */
WRBUF mc_key;
int live_set; /* 0=no hit count, 1=cached hit, 2=hits + real set */
void ZOOM_handle_facet_list(ZOOM_resultset r, Z_FacetList *fl)
{
int j;
- r->num_facets = fl->num;
+ r->num_res_facets = fl->num;
yaz_log(YLOG_DEBUG, "Facets found: %d", fl->num);
- r->facets = odr_malloc(r->odr, fl->num * sizeof(*r->facets));
+ r->res_facets = odr_malloc(r->odr, fl->num * sizeof(*r->res_facets));
r->facets_names = odr_malloc(r->odr, fl->num * sizeof(*r->facets_names));
for (j = 0; j < fl->num; j++)
{
- r->facets[j] = get_zoom_facet_field(r->odr, fl->elements[j]);
- if (!r->facets[j])
+ r->res_facets[j] = get_zoom_facet_field(r->odr, fl->elements[j]);
+ if (!r->res_facets[j])
+ {
+ r->facets_names[j] = 0;
yaz_log(YLOG_DEBUG, "Facet field missing on index %d !", j);
- r->facets_names[j] = (char *) ZOOM_facet_field_name(r->facets[j]);
+ }
+ else
+ r->facets_names[j] = (char *)
+ ZOOM_facet_field_name(r->res_facets[j]);
}
}