ZOOM_connection_search(ZOOM_connection c, ZOOM_query q)
{
ZOOM_resultset r = ZOOM_resultset_create();
- const char *cp;
ZOOM_task task;
int start, count;
- const char *syntax, *elementSetName, *schema, *facets;
+ const char *syntax, *elementSetName, *schema;
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,
+ 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);
(cp != 0 ? "presentChunk": "step"), 0);
}
r->piggyback = ZOOM_options_get_bool(r->options, "piggyback", 1);
- cp = ZOOM_options_get(r->options, "setname");
- if (cp)
- r->setname = xstrdup(cp);
-
- r->databaseNames = ZOOM_connection_get_databases(c, c->options, &r->num_databaseNames,
- r->odr);
-
+ r->setname = odr_strdup_null(r->odr,
+ ZOOM_options_get(r->options, "setname"));
+ r->databaseNames = ZOOM_connection_get_databases(c, c->options,
+ &r->num_databaseNames,
+ r->odr);
r->connection = c;
r->next = c->resultsets;
c->resultsets = r;
ZOOM_query_destroy(r->query);
ZOOM_options_destroy(r->options);
odr_destroy(r->odr);
- xfree(r->setname);
yaz_mutex_destroy(&r->mutex);
#if SHPTR
YAZ_SHPTR_DEC(r->record_wrbuf, wrbuf_destroy);
ZOOM_memcached_search(c, resultset);
if (!resultset->setname)
- resultset->setname = xstrdup("default");
+ resultset->setname = odr_strdup(resultset->odr, "default");
ZOOM_options_set(resultset->options, "setname", resultset->setname);
start = &c->tasks->u.search.start;
count = &c->tasks->u.search.count;
const char *elementSetName;
const char *smallSetElementSetName;
const char *mediumSetElementSetName;
- const char *facets;
assert(c->tasks);
assert(c->tasks->which == ZOOM_TASK_SEARCH);
yaz_oi_set_facetlist(oi, c->odr_out, facet_list);
}
else
- yaz_log(YLOG_WARN, "Unable to parse facets: %s", facets);
+ yaz_log(YLOG_WARN, "Unable to parse facets: %s", r->req_facets);
}
assert(r);
if (!rp)
break;
}
- r->setname = xstrdup(setname);
+ r->setname = odr_strdup(r->odr, setname);
yaz_log(c->log_details, "%p ZOOM_connection_send_search: "
"allocating set %s", c, r->setname);
}
{
yaz_log(c->log_details, "%p ZOOM_connection_send_search: using "
"default set", c);
- r->setname = xstrdup("default");
+ r->setname = odr_strdup(r->odr, "default");
}
ZOOM_options_set(r->options, "setname", r->setname);
}