X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=recctrl%2Falvis.c;h=1a28b762f2eac0275c81f3c830af422a2bbcc2e9;hb=f7a3769dede0071696bdcc13ae2ee1efe6d52d96;hp=c25b5ce4e3dd85fa68a58264775d33ea8bb510a4;hpb=1c13455bb1e12b4e74361e58d5862c9597c1b5c7;p=idzebra-moved-to-github.git diff --git a/recctrl/alvis.c b/recctrl/alvis.c index c25b5ce..1a28b76 100644 --- a/recctrl/alvis.c +++ b/recctrl/alvis.c @@ -1,4 +1,4 @@ -/* $Id: alvis.c,v 1.7 2005-08-22 14:39:47 adam Exp $ +/* $Id: alvis.c,v 1.11 2006-05-10 08:13:28 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -249,15 +249,16 @@ static struct filter_schema *lookup_schema(struct filter_info *tinfo, return 0; } -static void filter_config(void *clientData, Res res, const char *args) +static ZEBRA_RES filter_config(void *clientData, Res res, const char *args) { struct filter_info *tinfo = clientData; if (!args || !*args) - args = "xsltfilter.xml"; + return ZEBRA_FAIL; if (tinfo->fname && !strcmp(args, tinfo->fname)) - return; + return ZEBRA_OK; destroy_schemas(tinfo); create_schemas(tinfo, args); + return ZEBRA_OK; } static void filter_destroy(void *clientData) @@ -556,13 +557,18 @@ static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p) if (p->comp) { - if (p->comp->which != Z_RecordComp_simple - || p->comp->u.simple->which != Z_ElementSetNames_generic) + if (p->comp->which == Z_RecordComp_simple + && p->comp->u.simple->which == Z_ElementSetNames_generic) { - p->diagnostic = YAZ_BIB1_PRESENT_COMP_SPEC_PARAMETER_UNSUPP; - return 0; + esn = p->comp->u.simple->u.generic; + } + else if (p->comp->which == Z_RecordComp_complex + && p->comp->u.complex->generic->elementSpec + && p->comp->u.complex->generic->elementSpec->which == + Z_ElementSpec_elementSetName) + { + esn = p->comp->u.complex->generic->elementSpec->u.elementSetName; } - esn = p->comp->u.simple->u.generic; } schema = lookup_schema(tinfo, esn); if (!schema) @@ -576,13 +582,15 @@ static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p) window_size = atoi(schema->include_snippet); params[0] = 0; - set_param_str(params, "schema", esn, p->odr); + set_param_int(params, "id", p->localno, p->odr); if (p->fname) set_param_str(params, "filename", p->fname, p->odr); + if (p->staticrank >= 0) + set_param_int(params, "rank", p->staticrank, p->odr); + set_param_str(params, "schema", esn, p->odr); if (p->score >= 0) set_param_int(params, "score", p->score, p->odr); set_param_int(params, "size", p->recordSize, p->odr); - set_param_int(params, "id", p->localno, p->odr); if (window_size >= 0) set_param_xml(params, "snippet", snippet_doc(p, 1, window_size), @@ -671,3 +679,11 @@ idzebra_filter &filter_type, 0, }; +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +