diff --git a/src/Search/Filters/TagFilter.php b/src/Search/Filters/TagFilter.php index 4fee563a..698293aa 100644 --- a/src/Search/Filters/TagFilter.php +++ b/src/Search/Filters/TagFilter.php @@ -13,6 +13,7 @@ class TagFilter extends BasicFilter implements IFilter const REQUIREMENT_CREATION_TIME = 'creationTime'; const REQUIREMENT_LAST_EDIT_TIME = 'lastEditTime'; const REQUIREMENT_CATEGORY = 'category'; + const REQUIREMENT_USAGE_COUNT = 'usages'; public function __construct() { diff --git a/src/Search/Parsers/TagSearchParser.php b/src/Search/Parsers/TagSearchParser.php index 3e77c204..7163ad60 100644 --- a/src/Search/Parsers/TagSearchParser.php +++ b/src/Search/Parsers/TagSearchParser.php @@ -40,6 +40,16 @@ class TagSearchParser extends AbstractSearchParser return; } + if ($this->matches($token->getKey(), ['usage_count', 'usages', 'usage'])) + { + $this->addRequirementFromToken( + $filter, + $token, + TagFilter::REQUIREMENT_USAGE_COUNT, + self::ALLOW_RANGES | self::ALLOW_COMPOSITE); + return; + } + if ($this->matches($token->getKey(), ['category'])) { $this->addRequirementFromToken(