From: rich Date: Tue, 2 Nov 2004 22:26:36 +0000 (+0000) Subject: Fixed a bug triggered when the user typed search terms in quotes. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=744ad347df455887349c683dd1c57af2b1ac0d28;p=cocanwiki.git Fixed a bug triggered when the user typed search terms in quotes. Set the line-height slightly narrower for content text. --- diff --git a/html/_css/search.css b/html/_css/search.css index 624b08b..657090a 100644 --- a/html/_css/search.css +++ b/html/_css/search.css @@ -1,4 +1,4 @@ -/* $Id: search.css,v 1.1 2004/11/02 18:47:54 rich Exp $ */ +/* $Id: search.css,v 1.2 2004/11/02 22:26:36 rich Exp $ */ div#titles { border: 1px solid #ccc; @@ -16,6 +16,7 @@ ul#contents { span.content { font-size: 0.7em; + line-height: 1em; } span.last_modified_date { diff --git a/scripts/search.ml b/scripts/search.ml index 2b2e8b9..456c0e9 100644 --- a/scripts/search.ml +++ b/scripts/search.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: search.ml,v 1.7 2004/11/02 19:21:17 rich Exp $ + * $Id: search.ml,v 1.8 2004/11/02 22:26:36 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 @@ -60,6 +60,8 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid host user = if have_query then ( (* Get the keywords from the query string. *) 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 (* Turn the keywords into a tsearch2 ts_query string. *)