mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 19:19:59 +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
|
type: long
|
||||||
seed_count:
|
seed_count:
|
||||||
type: long
|
type: long
|
||||||
|
comment_count:
|
||||||
|
type: long
|
||||||
# these ids are really only for filtering, thus keyword
|
# these ids are really only for filtering, thus keyword
|
||||||
uploader_id:
|
uploader_id:
|
||||||
type: keyword
|
type: keyword
|
||||||
|
|
|
@ -51,6 +51,7 @@ def mk_es(t):
|
||||||
"uploader_id": t.uploader_id,
|
"uploader_id": t.uploader_id,
|
||||||
"main_category_id": t.main_category_id,
|
"main_category_id": t.main_category_id,
|
||||||
"sub_category_id": t.sub_category_id,
|
"sub_category_id": t.sub_category_id,
|
||||||
|
"comment_count": t.comment_count,
|
||||||
# XXX all the bitflags are numbers
|
# XXX all the bitflags are numbers
|
||||||
"anonymous": bool(t.anonymous),
|
"anonymous": bool(t.anonymous),
|
||||||
"trusted": bool(t.trusted),
|
"trusted": bool(t.trusted),
|
||||||
|
|
|
@ -86,6 +86,7 @@ def reindex_torrent(t, index_name):
|
||||||
"uploader_id": t['uploader_id'],
|
"uploader_id": t['uploader_id'],
|
||||||
"main_category_id": t['main_category_id'],
|
"main_category_id": t['main_category_id'],
|
||||||
"sub_category_id": t['sub_category_id'],
|
"sub_category_id": t['sub_category_id'],
|
||||||
|
"comment_count": t['comment_count'],
|
||||||
# XXX all the bitflags are numbers
|
# XXX all the bitflags are numbers
|
||||||
"anonymous": bool(f & TorrentFlags.ANONYMOUS),
|
"anonymous": bool(f & TorrentFlags.ANONYMOUS),
|
||||||
"trusted": bool(f & TorrentFlags.TRUSTED),
|
"trusted": bool(f & TorrentFlags.TRUSTED),
|
||||||
|
|
Loading…
Reference in a new issue