From 87f0188b0b31dde5f5510a30b17a89f45384f271 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 31 Aug 2007 07:02:24 +0000 Subject: [PATCH] Fixes for snippet/scan where we do "reextract". The setStoreData handle was assumed to be present. The alvis and dom filter now check for it. For the reextract case it's NULL and we do not do splitting. --- index/alvis.c | 7 ++++--- index/extract.c | 4 +++- index/mod_dom.c | 7 ++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/index/alvis.c b/index/alvis.c index 10c603a..2a24a64 100644 --- a/index/alvis.c +++ b/index/alvis.c @@ -1,4 +1,4 @@ -/* $Id: alvis.c,v 1.18 2007-08-21 07:49:18 adam Exp $ +/* $Id: alvis.c,v 1.19 2007-08-31 07:02:24 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -487,7 +487,8 @@ static int extract_doc(struct filter_info *tinfo, struct recExtractCtrl *p, xmlDocDumpMemory(doc, &buf_out, &len_out); if (p->flagShowRecords) fwrite(buf_out, len_out, 1, stdout); - (*p->setStoreData)(p, buf_out, len_out); + if (p->setStoreData) + (*p->setStoreData)(p, buf_out, len_out); xmlFree(buf_out); xmlFreeDoc(doc); @@ -573,7 +574,7 @@ static int filter_extract(void *clientData, struct recExtractCtrl *p) struct filter_info *tinfo = clientData; odr_reset(tinfo->odr); - if (tinfo->split_level == 0) + if (tinfo->split_level == 0 || p->setStoreData == 0) return extract_full(tinfo, p); else return extract_split(tinfo, p); diff --git a/index/extract.c b/index/extract.c index ac188a0..cec5575 100644 --- a/index/extract.c +++ b/index/extract.c @@ -1,4 +1,4 @@ -/* $Id: extract.c,v 1.261 2007-08-22 08:01:32 adam Exp $ +/* $Id: extract.c,v 1.262 2007-08-31 07:02:24 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -325,6 +325,8 @@ void extract_snippet(ZebraHandle zh, zebra_snippets *sn, init_extractCtrl(zh, &extractCtrl); + extractCtrl.setStoreData = 0; + r = (*rt->extract)(recTypeClientData, &extractCtrl); } diff --git a/index/mod_dom.c b/index/mod_dom.c index 39733af..864529a 100644 --- a/index/mod_dom.c +++ b/index/mod_dom.c @@ -1,4 +1,4 @@ -/* $Id: mod_dom.c,v 1.38 2007-06-19 19:39:54 adam Exp $ +/* $Id: mod_dom.c,v 1.39 2007-08-31 07:02:24 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -1119,7 +1119,8 @@ static int convert_extract_doc(struct filter_info *tinfo, else xmlDocDumpMemory(store_doc ? store_doc : doc, &buf_out, &len_out); - (*p->setStoreData)(p, buf_out, len_out); + if (p->setStoreData) + (*p->setStoreData)(p, buf_out, len_out); xmlFree(buf_out); if (store_doc) @@ -1308,7 +1309,7 @@ static int filter_extract(void *clientData, struct recExtractCtrl *p) switch(input->type) { case DOM_INPUT_XMLREADER: - if (input->u.xmlreader.split_level == 0) + if (input->u.xmlreader.split_level == 0 || p->setStoreData == 0) return extract_xml_full(tinfo, input, p); else return extract_xml_split(tinfo, input, p); -- 1.7.10.4