From 865c268791a99fa57aa818528c6f2473b26d954f Mon Sep 17 00:00:00 2001 From: Kazutaka Miyasaka Date: Sun, 20 Sep 2009 14:11:16 +0200 Subject: enhanced full-text search function Ignore-this: cb05f50ca4de12e1cdf3a6cfb0e1b8bc - better search experience in Asian language - sophisticated search query syntax (OR, grouping, etc.) darcs-hash:20090920121116-9b77a-2718be7a043374669037b10d94101fc70efb95e3.gz --- inc/html.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index b0cffe887..9581a27e7 100644 --- a/inc/html.php +++ b/inc/html.php @@ -305,11 +305,6 @@ function html_search(){ //check if search is restricted to namespace if(preg_match('/@([^@]*)/',$QUERY,$match)) { $id = cleanID($match[1]); - if(empty($id)) { - print '
'.$lang['nothingfound'].'
'; - flush(); - return; - } } else { $id = cleanID($QUERY); } @@ -325,7 +320,7 @@ function html_search(){ //do quick pagesearch $data = array(); - $data = ft_pageLookup($id); + if($id) $data = ft_pageLookup($id); if(count($data)){ print '
'; print '

'.$lang['quickhits'].':

'; @@ -355,13 +350,15 @@ function html_search(){ foreach($data as $id => $cnt){ print '
'; print html_wikilink(':'.$id,useHeading('navigation')?NULL:$id,$regex); - print ': '.$cnt.' '.$lang['hits'].'
'; - if($num < 15){ // create snippets for the first number of matches only #FIXME add to conf ? - print '
'.ft_snippet($id,$regex).'
'; + if($cnt !== 0){ + print ': '.$cnt.' '.$lang['hits'].'
'; + if($num < 15){ // create snippets for the first number of matches only #FIXME add to conf ? + print '
'.ft_snippet($id,$regex).'
'; + } + $num++; } print '
'; flush(); - $num++; } }else{ print '
'.$lang['nothingfound'].'
'; -- cgit v1.2.3