1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 09:10:00 +00:00

Update ElasticSeach index and scripts for comment_count

This commit is contained in:
TheAMM 2017-05-26 16:12:47 +03:00
parent b5ebebf98e
commit 9cd6c506ae
3 changed files with 4 additions and 0 deletions

View file

@ -91,6 +91,8 @@ mappings:
type: long
seed_count:
type: long
comment_count:
type: long
# these ids are really only for filtering, thus keyword
uploader_id:
type: keyword

View file

@ -51,6 +51,7 @@ def mk_es(t):
"uploader_id": t.uploader_id,
"main_category_id": t.main_category_id,
"sub_category_id": t.sub_category_id,
"comment_count": t.comment_count,
# XXX all the bitflags are numbers
"anonymous": bool(t.anonymous),
"trusted": bool(t.trusted),

View file

@ -86,6 +86,7 @@ def reindex_torrent(t, index_name):
"uploader_id": t['uploader_id'],
"main_category_id": t['main_category_id'],
"sub_category_id": t['sub_category_id'],
"comment_count": t['comment_count'],
# XXX all the bitflags are numbers
"anonymous": bool(f & TorrentFlags.ANONYMOUS),
"trusted": bool(f & TorrentFlags.TRUSTED),