If fetching the RSS from the feed fails, keep using the old, cached
[cocanwiki.git] / scripts / search.ml
index 13899ce..49014c5 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: search.ml,v 1.10 2006/03/28 16:24:08 rich Exp $
+ * $Id: search.ml,v 1.13 2006/12/06 09:46:57 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ open Cocanwiki_date
 let split_words = Pcre.regexp "\\W+"
 
 let run r (q : cgi) dbh hostid host user =
-  let template = get_template dbh hostid "search.html" in
+  let template = get_template dbh hostid "search.html" in
 
   template#set "canonical_hostname" host.canonical_hostname;
 
@@ -62,7 +62,7 @@ let run r (q : cgi) dbh hostid host user =
       let keywords = Pcre.split ~rex:split_words query in
       let keywords =
        List.filter (fun s -> not (string_is_whitespace s)) keywords in
-      let keywords = List.map String.lowercase keywords in
+      let keywords = List.map lowercase keywords in
 
       (* Turn the keywords into a tsearch2 ts_query string. *)
       let tsquery = String.concat "&" keywords in
@@ -186,7 +186,7 @@ let run r (q : cgi) dbh hostid host user =
             let content =
               truncate 160
                 (Wikilib.text_of_xhtml
-                   (Wikilib.xhtml_of_content dbh hostid content)) in
+                   (Wikilib.xhtml_of_content dbh hostid content)) in
             let linkname = linkname_of_sectionname sectionname in
             let last_modified = printable_date last_modified in
             [ "url", Template.VarString url;