mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 19:40:00 +00:00
es: fix remaining 7.xisms
the enabled: false apparently only applies to "object" fields now, need index: false and the _type got removed everywhere. Seems to work now.
This commit is contained in:
parent
b797f45f28
commit
093eabf158
|
@ -104,9 +104,11 @@ mappings:
|
||||||
analyzer: exact_analyzer
|
analyzer: exact_analyzer
|
||||||
created_time:
|
created_time:
|
||||||
type: date
|
type: date
|
||||||
# Only in the ES index for generating magnet links
|
#
|
||||||
|
# Only in the ES index for generating magnet links
|
||||||
info_hash:
|
info_hash:
|
||||||
enabled: false
|
type: keyword
|
||||||
|
index: false
|
||||||
filesize:
|
filesize:
|
||||||
type: long
|
type: long
|
||||||
anonymous:
|
anonymous:
|
||||||
|
|
|
@ -34,7 +34,6 @@ def pad_bytes(in_bytes, size):
|
||||||
def mk_es(t, index_name):
|
def mk_es(t, index_name):
|
||||||
return {
|
return {
|
||||||
"_id": t.id,
|
"_id": t.id,
|
||||||
"_type": "torrent",
|
|
||||||
"_index": index_name,
|
"_index": index_name,
|
||||||
"_source": {
|
"_source": {
|
||||||
# we're also indexing the id as a number so you can
|
# we're also indexing the id as a number so you can
|
||||||
|
|
|
@ -114,7 +114,6 @@ def reindex_torrent(t, index_name):
|
||||||
return {
|
return {
|
||||||
'_op_type': 'update',
|
'_op_type': 'update',
|
||||||
'_index': index_name,
|
'_index': index_name,
|
||||||
'_type': 'torrent',
|
|
||||||
'_id': str(t['id']),
|
'_id': str(t['id']),
|
||||||
"doc": doc,
|
"doc": doc,
|
||||||
"doc_as_upsert": True
|
"doc_as_upsert": True
|
||||||
|
@ -128,7 +127,6 @@ def reindex_stats(s, index_name):
|
||||||
return {
|
return {
|
||||||
'_op_type': 'update',
|
'_op_type': 'update',
|
||||||
'_index': index_name,
|
'_index': index_name,
|
||||||
'_type': 'torrent',
|
|
||||||
'_id': str(s['torrent_id']),
|
'_id': str(s['torrent_id']),
|
||||||
"doc": {
|
"doc": {
|
||||||
"stats_last_updated": s["last_updated"],
|
"stats_last_updated": s["last_updated"],
|
||||||
|
@ -141,7 +139,6 @@ def delet_this(row, index_name):
|
||||||
return {
|
return {
|
||||||
"_op_type": 'delete',
|
"_op_type": 'delete',
|
||||||
'_index': index_name,
|
'_index': index_name,
|
||||||
'_type': 'torrent',
|
|
||||||
'_id': str(row['values']['id'])}
|
'_id': str(row['values']['id'])}
|
||||||
|
|
||||||
# we could try to make this script robust to errors from es or mysql, but since
|
# we could try to make this script robust to errors from es or mysql, but since
|
||||||
|
|
Loading…
Reference in a new issue