search by score
git-svn-id: file:///home/shish/svn/shimmie2/trunk@787 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
b28c77b32d
commit
ffe6b2ab7c
@ -59,6 +59,15 @@ class NumericScore extends Extension {
|
||||
if(is_a($event, 'ParseLinkTemplateEvent')) {
|
||||
$event->replace('$score', $event->image->numeric_score);
|
||||
}
|
||||
|
||||
if(is_a($event, 'SearchTermParseEvent')) {
|
||||
$matches = array();
|
||||
if(preg_match("/score(<|=|>)(\d+)/", $event->term, $matches)) {
|
||||
$cmp = $matches[1];
|
||||
$score = $matches[2];
|
||||
$event->set_querylet(new Querylet("AND (numeric_score $cmp $score)"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function install() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user