Fixed scoremin and scoremax
This commit is contained in:
parent
6a751ed0b2
commit
2996f27671
1 changed files with 9 additions and 5 deletions
|
@ -43,12 +43,16 @@ class PostSearchParser extends AbstractSearchParser
|
||||||
$tokenKey = $token->getKey();
|
$tokenKey = $token->getKey();
|
||||||
$tokenValue = $token->getValue();
|
$tokenValue = $token->getValue();
|
||||||
|
|
||||||
if ($this->matches($tokenKey, ['tag_min', 'tag_max', 'fav_min', 'fav_max', 'score_min', 'score_max']))
|
$countAliases = ['tag_count' => 'tag', 'fav_count' => 'fav', 'score' => 'score'];
|
||||||
|
foreach ($countAliases as $realKey => $baseAlias)
|
||||||
{
|
{
|
||||||
$token = new NamedSearchToken();
|
if ($this->matches($tokenKey, [$baseAlias . '_min', $baseAlias . '_max']))
|
||||||
$token->setKey(str_replace('__', '_', str_replace(['min', 'max'], '_count', $tokenKey)));
|
{
|
||||||
$token->setValue(strpos($tokenKey, 'min') !== false ? $tokenValue . '..' : '..' . $tokenValue);
|
$token = new NamedSearchToken();
|
||||||
return $this->decorateFilterFromNamedToken($filter, $token);
|
$token->setKey($realKey);
|
||||||
|
$token->setValue(strpos($tokenKey, 'min') !== false ? $tokenValue . '..' : '..' . $tokenValue);
|
||||||
|
return $this->decorateFilterFromNamedToken($filter, $token);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$map =
|
$map =
|
||||||
|
|
Loading…
Reference in a new issue