Added feature_count to search terms
This commit is contained in:
parent
5df5a78df5
commit
e2bc5d3415
3 changed files with 7 additions and 0 deletions
|
@ -115,6 +115,7 @@
|
||||||
{search: 'score:4', description: 'having score of 4'},
|
{search: 'score:4', description: 'having score of 4'},
|
||||||
{search: 'tag_count:7', description: 'tagged with exactly seven tags'},
|
{search: 'tag_count:7', description: 'tagged with exactly seven tags'},
|
||||||
{search: 'note_count:1..', description: 'having at least one post note'},
|
{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:today', description: 'posted today'},
|
||||||
{search: 'date:yesterday', description: 'posted yesterday'},
|
{search: 'date:yesterday', description: 'posted yesterday'},
|
||||||
{search: 'date:2000', description: 'posted in year 2000'},
|
{search: 'date:2000', description: 'posted in year 2000'},
|
||||||
|
|
|
@ -26,6 +26,7 @@ class PostFilter extends BasicFilter implements IFilter
|
||||||
const REQUIREMENT_FAV_COUNT = 'posts.favCount';
|
const REQUIREMENT_FAV_COUNT = 'posts.favCount';
|
||||||
const REQUIREMENT_COMMENT_COUNT = 'posts.commentCount';
|
const REQUIREMENT_COMMENT_COUNT = 'posts.commentCount';
|
||||||
const REQUIREMENT_NOTE_COUNT = 'posts.noteCount';
|
const REQUIREMENT_NOTE_COUNT = 'posts.noteCount';
|
||||||
|
const REQUIREMENT_FEATURE_COUNT = 'posts.featureCount';
|
||||||
const REQUIREMENT_SCORE = 'posts.score';
|
const REQUIREMENT_SCORE = 'posts.score';
|
||||||
const REQUIREMENT_UPLOADER = 'uploader.name';
|
const REQUIREMENT_UPLOADER = 'uploader.name';
|
||||||
const REQUIREMENT_SAFETY = 'posts.safety';
|
const REQUIREMENT_SAFETY = 'posts.safety';
|
||||||
|
|
|
@ -96,6 +96,11 @@ class PostSearchParserConfig extends AbstractSearchParserConfig
|
||||||
['note_count', 'notes'],
|
['note_count', 'notes'],
|
||||||
self::ALLOW_COMPOSITE | self::ALLOW_RANGE);
|
self::ALLOW_COMPOSITE | self::ALLOW_RANGE);
|
||||||
|
|
||||||
|
$this->defineNamedTokenParser(
|
||||||
|
PostFilter::REQUIREMENT_FEATURE_COUNT,
|
||||||
|
['feature_count', 'featured'],
|
||||||
|
self::ALLOW_COMPOSITE | self::ALLOW_RANGE);
|
||||||
|
|
||||||
$this->defineNamedTokenParser(
|
$this->defineNamedTokenParser(
|
||||||
PostFilter::REQUIREMENT_SCORE,
|
PostFilter::REQUIREMENT_SCORE,
|
||||||
['score'],
|
['score'],
|
||||||
|
|
Loading…
Reference in a new issue