Skip to content
Snippets Groups Projects
Commit 248a7321 authored by matthiasgrimm's avatar matthiasgrimm
Browse files

extended search fix

This patch fixes a bug in the search code and did some
optimizations. Furtheron queries with only excluded
words will be rejected because they won't produce
usable output and waste only time.

darcs-hash:20050604212026-7ef76-7a096791875407859eae390290165e4b6e7ef082.gz
parent 4735a949
No related branches found
No related tags found
No related merge requests found
......@@ -317,6 +317,9 @@ function search_fulltext(&$data,$base,$file,$type,$lvl,$opts){
break;
}
}
// a search without any posword is useless
if (!count($poswords)) return true;
$req = count($poswords) ? $reg .= '^(?=.*?'.join(')(?=.*?',$poswords).')' : '^';
$reg .= count($negwords) ? '((?!'.join('|',$negwords).').)*$' : '.*$';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment