r->connection = 0;
r->databaseNames = 0;
r->num_databaseNames = 0;
+ r->req_facets = 0;
r->res_facets = 0;
r->num_res_facets = 0;
r->facets_names = 0;
const char *cp;
ZOOM_task task;
int start, count;
- const char *syntax, *elementSetName, *schema;
+ const char *syntax, *elementSetName, *schema, *facets;
yaz_log(c->log_api, "%p ZOOM_connection_search set %p query %p", c, r, q);
r->r_sort_spec = ZOOM_query_get_sortspec(q);
r->query = q;
r->options = ZOOM_options_create_with_parent(c->options);
+ r->req_facets = odr_strdup_null(r->odr,
+ ZOOM_options_get(r->options, "facets"));
start = ZOOM_options_get_int(r->options, "start", 0);
count = ZOOM_options_get_int(r->options, "count", 0);
{
wrbuf_destroy(w);
}
wrbuf_puts(r->mc_key, ";");
+ if (r->req_facets)
+ wrbuf_puts(r->mc_key, r->req_facets);
#endif
}
struct WRBUF_shptr *record_wrbuf;
#endif
ZOOM_resultset next;
+ char *req_facets;
ZOOM_facet_field *res_facets;
int num_res_facets;
char **facets_names; /* redundant. For ZOOM_resultset_facets_names only */
#if YAZ_HAVE_XML2
zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c)
{
- const char *facets = 0;
int i;
int *start, *count;
ZOOM_resultset resultset = 0;
ZOOM_options_set(resultset->options, "setname", resultset->setname);
start = &c->tasks->u.search.start;
count = &c->tasks->u.search.count;
- facets = ZOOM_options_get(resultset->options, "facets");
- if (facets)
- facet_list = yaz_pqf_parse_facet_list(c->odr_out, facets);
+ if (resultset->req_facets)
+ facet_list = yaz_pqf_parse_facet_list(c->odr_out,
+ resultset->req_facets);
schema = c->tasks->u.search.schema;
if (resultset->live_set)
if (!mediumSetElementSetName)
mediumSetElementSetName = elementSetName;
- facets = ZOOM_options_get(r->options, "facets");
- if (facets) {
- Z_FacetList *facet_list = yaz_pqf_parse_facet_list(c->odr_out, facets);
- if (facet_list) {
+ if (r->req_facets)
+ {
+ Z_FacetList *facet_list =
+ yaz_pqf_parse_facet_list(c->odr_out, r->req_facets);
+ if (facet_list)
+ {
Z_OtherInformation **oi = &search_req->additionalSearchInfo;
yaz_oi_set_facetlist(oi, c->odr_out, facet_list);
}