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:
parent
b5ebebf98e
commit
9cd6c506ae
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue