From 370032740cf864ea33ca630dfe32a3cd860c4f8c Mon Sep 17 00:00:00 2001 From: dockes Date: Fri, 28 Jan 2005 08:46:27 +0000 Subject: [PATCH] xapian 0.8.3 --- src/internfile/mh_html.cpp | 2 +- src/rcldb/rcldb.cpp | 43 +++++++++++++++----------------------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/internfile/mh_html.cpp b/src/internfile/mh_html.cpp index 1d7e29bd..374d43ed 100644 --- a/src/internfile/mh_html.cpp +++ b/src/internfile/mh_html.cpp @@ -136,7 +136,7 @@ MyHtmlParser::opening_tag(const string &tag, const map &p) } } } - } else if (tag == "p" || tag == "br") { + } else if (tag == "p" || tag == "br" || tag == "li") { dump += "\n"; } else if (tag == "script") { in_script_tag = true; diff --git a/src/rcldb/rcldb.cpp b/src/rcldb/rcldb.cpp index 0e7b4211..7e02bf32 100644 --- a/src/rcldb/rcldb.cpp +++ b/src/rcldb/rcldb.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.9 2005-01-26 13:03:02 dockes Exp $ (C) 2004 J.F.Dockes"; +static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.10 2005-01-28 08:41:40 dockes Exp $ (C) 2004 J.F.Dockes"; #endif #include @@ -257,37 +257,28 @@ bool Rcl::Db::add(const string &fn, const Rcl::Doc &doc) string pathterm = "P" + fn; newdocument.add_term(pathterm); const char *fnc = fn.c_str(); - if (1 /*dupes == DUPE_replace*/) { - // If this document has already been indexed, update the existing - // entry. - try { + + // If this document has already been indexed, update the existing + // entry. + try { #if 0 - Xapian::docid did = + Xapian::docid did = #endif - ndb->wdb.replace_document(pathterm, newdocument); + ndb->wdb.replace_document(pathterm, newdocument); #if 0 - if (did < updated.size()) { - updated[did] = true; - LOGDEB(("%s updated\n", fnc)); - } else { - LOGDEB(("%s added\n", fnc)); - } -#endif - } catch (...) { - // FIXME: is this ever actually needed? - ndb->wdb.add_document(newdocument); - LOGDEB(("%s added (failed re-seek for duplicate).\n", fnc)); - } - } else { - try { - ndb->wdb.add_document(newdocument); + if (did < updated.size()) { + updated[did] = true; + LOGDEB(("%s updated\n", fnc)); + } else { LOGDEB(("%s added\n", fnc)); - } catch (...) { - LOGERR(("%s : Got exception while adding doc\n", fnc)); - return false; } +#endif + } catch (...) { + // FIXME: is this ever actually needed? + ndb->wdb.add_document(newdocument); + LOGDEB(("%s added (failed re-seek for duplicate).\n", fnc)); } - return true; + return true; }