X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=ztest%2Fztest.c;h=c4e7b49685a3556e7feec5339c18c4ab2c44f84b;hb=082b5178292fbba931469da363fe6541dda41c40;hp=69a8786dd727ba83426845aeee7036295122c62c;hpb=b56b6242e4e9c0011b9a2dae6d67c3ef0789251f;p=yaz-moved-to-github.git diff --git a/ztest/ztest.c b/ztest/ztest.c index 69a8786..c4e7b49 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -232,7 +232,7 @@ static void addterms(ODR odr, Z_FacetField *facet_field, const char *facet_name) int index; int freq = 100; int length = strlen(facet_name) + 10; - char key[length]; + char *key = odr_malloc(odr, length); key[0] = '\0'; for (index = 0; index < facet_field->num_terms; index++) { Z_Term *term; @@ -253,7 +253,7 @@ Z_OtherInformation *build_facet_response(ODR odr, Z_FacetList *facet_list) { for (index = 0; index < facet_list->num; index++) { struct yaz_facet_attr attrvalues; yaz_facet_attr_init(&attrvalues); - attrvalues.limit = 10; + attrvalues.limit = 0; yaz_facet_attr_get_z_attributes(facet_list->elements[index]->attributes, &attrvalues); yaz_log(YLOG_LOG, "Attributes: %s %d ", attrvalues.useattr, attrvalues.limit); @@ -396,9 +396,7 @@ int ztest_search(void *handle, bend_search_rr *rr) if (1) { - /* TODO Not general. Only handles one (Facet) OtherInformation. Overwrite */ - Z_FacetList *facet_list = extract_facet_request(rr->stream, rr->search_input); - + Z_FacetList *facet_list = yaz_oi_get_facetlist(&rr->search_input); if (facet_list) { yaz_log(YLOG_LOG, "%d Facets in search request.", facet_list->num); rr->search_info = build_facet_response(rr->stream, facet_list);