From: Marc Cromme Date: Wed, 24 May 2006 08:23:01 +0000 (+0000) Subject: returning default schema name or identifier when no element set is specified X-Git-Tag: before.bug.529~103 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=a92a4f15b3e570c055590166ae91f497e61cd949;p=idzebra-moved-to-github.git returning default schema name or identifier when no element set is specified --- diff --git a/recctrl/alvis.c b/recctrl/alvis.c index c7fd287..7e9aa76 100644 --- a/recctrl/alvis.c +++ b/recctrl/alvis.c @@ -1,4 +1,4 @@ -/* $Id: alvis.c,v 1.12 2006-05-23 15:21:58 marc Exp $ +/* $Id: alvis.c,v 1.13 2006-05-24 08:23:01 marc Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -599,11 +599,17 @@ static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p) set_param_str(params, "filename", p->fname, p->odr); if (p->staticrank >= 0) set_param_int(params, "rank", p->staticrank, p->odr); + if (esn) set_param_str(params, "schema", esn, p->odr); else - set_param_str(params, "schema", "", p->odr); - /* should use default elem set here .. */ + if (schema->name) + set_param_str(params, "schema", schema->name, p->odr); + else if (schema->identifier) + set_param_str(params, "schema", schema->identifier, p->odr); + else + set_param_str(params, "schema", "", p->odr); + if (p->score >= 0) set_param_int(params, "score", p->score, p->odr); set_param_int(params, "size", p->recordSize, p->odr); diff --git a/recctrl/xslt.c b/recctrl/xslt.c index 15dce30..bdea2e7 100644 --- a/recctrl/xslt.c +++ b/recctrl/xslt.c @@ -1,4 +1,4 @@ -/* $Id: xslt.c,v 1.22 2006-05-23 15:21:58 marc Exp $ +/* $Id: xslt.c,v 1.23 2006-05-24 08:23:01 marc Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -642,10 +642,15 @@ static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p) if (p->staticrank >= 0) set_param_int(params, "rank", p->staticrank, p->odr); - /* should use default elem set here .. */ if (esn) - set_param_str(params, "schema", esn, p->odr); - else - set_param_str(params, "schema", "", p->odr); + if (esn) + set_param_str(params, "schema", esn, p->odr); + else + if (schema->name) + set_param_str(params, "schema", schema->name, p->odr); + else if (schema->identifier) + set_param_str(params, "schema", schema->identifier, p->odr); + else + set_param_str(params, "schema", "", p->odr); if (p->score >= 0) set_param_int(params, "score", p->score, p->odr);