Added feature_count to search terms

This commit is contained in:
rr- 2015-12-29 11:57:25 +01:00
parent 5df5a78df5
commit e2bc5d3415
3 changed files with 7 additions and 0 deletions

View file

@ -115,6 +115,7 @@
{search: 'score:4', description: 'having score of 4'},
{search: 'tag_count:7', description: 'tagged with exactly seven tags'},
{search: 'note_count:1..', description: 'having at least one post note'},
{search: 'feature_count:1..', description: 'having been featured at least once'},
{search: 'date:today', description: 'posted today'},
{search: 'date:yesterday', description: 'posted yesterday'},
{search: 'date:2000', description: 'posted in year 2000'},

View file

@ -26,6 +26,7 @@ class PostFilter extends BasicFilter implements IFilter
const REQUIREMENT_FAV_COUNT = 'posts.favCount';
const REQUIREMENT_COMMENT_COUNT = 'posts.commentCount';
const REQUIREMENT_NOTE_COUNT = 'posts.noteCount';
const REQUIREMENT_FEATURE_COUNT = 'posts.featureCount';
const REQUIREMENT_SCORE = 'posts.score';
const REQUIREMENT_UPLOADER = 'uploader.name';
const REQUIREMENT_SAFETY = 'posts.safety';

View file

@ -96,6 +96,11 @@ class PostSearchParserConfig extends AbstractSearchParserConfig
['note_count', 'notes'],
self::ALLOW_COMPOSITE | self::ALLOW_RANGE);
$this->defineNamedTokenParser(
PostFilter::REQUIREMENT_FEATURE_COUNT,
['feature_count', 'featured'],
self::ALLOW_COMPOSITE | self::ALLOW_RANGE);
$this->defineNamedTokenParser(
PostFilter::REQUIREMENT_SCORE,
['score'],