server/search: allow searching by source URL content

This commit is contained in:
Shyam Sunder 2019-04-07 12:17:19 -04:00 committed by Marcin Kurczewski
parent 68bd168434
commit 1d8cfd5a89
2 changed files with 9 additions and 0 deletions

View file

@ -38,6 +38,10 @@
<td><code>fav</code></td>
<td>favorited by given user (accepts wildcards)</td>
</tr>
<tr>
<td><code>source</code></td>
<td>having given source URL (accepts wildcards)</td>
</tr>
<tr>
<td><code>tag-count</code></td>
<td>having given number of tags</td>

View file

@ -230,6 +230,11 @@ class PostSearchConfig(BaseSearchConfig):
_create_score_filter(-1)
),
(
['source'],
search_util.create_str_filter(model.Post.source)
),
(
['tag-count'],
search_util.create_num_filter(model.Post.tag_count)