Refactor database lookup to single function.
[idzebra-moved-to-github.git] / index / mod_dom.c
index 864529a..f369c68 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mod_dom.c,v 1.39 2007-08-31 07:02:24 adam Exp $
+/* $Id: mod_dom.c,v 1.41 2007-10-29 16:57:52 adam Exp $
    Copyright (C) 1995-2007
    Index Data ApS
 
@@ -780,7 +780,7 @@ static void index_value_of(struct filter_info *tinfo,
 
                 recword->index_name = (const char *)index;
                 if (type && *type)
-                    recword->index_type = *type;
+                    recword->index_type = (const char *) type;
 
                 /* writing debug out */
                 if (extctr->flagShowRecords)
@@ -790,10 +790,6 @@ static void index_value_of(struct filter_info *tinfo,
                             type ? (const char *) type : "null", 
                             text ? (const char *) text : "null");
                 
-                /* actually indexing the text given */
-                recword->index_name = (const char *)index;
-                if (type && *type)
-                    recword->index_type = *type;
                 (extctr->tokenAdd)(recword);
 
                 /* eat whitespaces */
@@ -1306,10 +1302,13 @@ static int filter_extract(void *clientData, struct recExtractCtrl *p)
         return RECCTRL_EXTRACT_ERROR_GENERIC;
     
     odr_reset(tinfo->odr_record);
+
+    if (p->setStoreData == 0)
+        return extract_xml_full(tinfo, input, p);
     switch(input->type)
     {
     case DOM_INPUT_XMLREADER:
-        if (input->u.xmlreader.split_level == 0 || p->setStoreData == 0)
+        if (input->u.xmlreader.split_level == 0)
             return extract_xml_full(tinfo, input, p);
         else
             return extract_xml_split(tinfo, input, p);