Commit 11636385 authored by lixiaofang's avatar lixiaofang

add

parent 66ffbe75
This diff is collapsed.
...@@ -48,6 +48,7 @@ class ESPerform(object): ...@@ -48,6 +48,7 @@ class ESPerform(object):
:return: :return:
""" """
try: try:
index_flag = None
assert (index_flag in [None, "read", "write"]) assert (index_flag in [None, "read", "write"])
official_index_name = cls.index_prefix + "-" + sub_index_name official_index_name = cls.index_prefix + "-" + sub_index_name
...@@ -191,8 +192,8 @@ class ESPerform(object): ...@@ -191,8 +192,8 @@ class ESPerform(object):
try: try:
assert (es_cli is not None) assert (es_cli is not None)
official_index_name = sub_index_name official_index_name = sub_index_name
# if sub_index_name != "mv-alpha-user-test-190711901": if sub_index_name != "mv-alpha-toipc-test-1907129011":
# official_index_name = cls.get_official_index_name(sub_index_name, "read") official_index_name = cls.get_official_index_name(sub_index_name, "read")
index_exists = es_cli.indices.exists(official_index_name) index_exists = es_cli.indices.exists(official_index_name)
if not index_exists: if not index_exists:
......
...@@ -18,6 +18,7 @@ ES_INFO_LIST = [ ...@@ -18,6 +18,7 @@ ES_INFO_LIST = [
] ]
ES_INDEX_PREFIX = "gm-dbmw" ES_INDEX_PREFIX = "gm-dbmw"
class ESPerform(object): class ESPerform(object):
cli_obj = None cli_obj = None
cli_info_list = ES_INFO_LIST cli_info_list = ES_INFO_LIST
...@@ -46,6 +47,7 @@ class ESPerform(object): ...@@ -46,6 +47,7 @@ class ESPerform(object):
:return: :return:
""" """
try: try:
index_flag = None
assert (index_flag in [None, "read", "write"]) assert (index_flag in [None, "read", "write"])
official_index_name = cls.index_prefix + "-" + sub_index_name official_index_name = cls.index_prefix + "-" + sub_index_name
...@@ -283,6 +285,7 @@ class ESPerform(object): ...@@ -283,6 +285,7 @@ class ESPerform(object):
logging.error("catch exception,err_msg:%s" % traceback.format_exc()) logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return True return True
# 先获取一部分数据 # 先获取一部分数据
es_cli_obj = ESPerform.get_cli() es_cli_obj = ESPerform.get_cli()
...@@ -362,12 +365,11 @@ for old_item in result_dict["hits"]: ...@@ -362,12 +365,11 @@ for old_item in result_dict["hits"]:
is_deleted = values["is_deleted"] is_deleted = values["is_deleted"]
if is_online != new_source["suggest"]["contexts"]["is_online"]: if is_online != new_source["suggest"]["contexts"]["is_online"]:
print(is_online) print(is_online)
print ("----is_online--------") print("----is_online--------")
if is_deleted != new_source["suggest"]["contexts"]["is_deleted"]: if is_deleted != new_source["suggest"]["contexts"]["is_deleted"]:
print(is_deleted) print(is_deleted)
print("-------is_deleted---------") print("-------is_deleted---------")
if old_source["is_deleted"] != new_source["is_deleted"]: if old_source["is_deleted"] != new_source["is_deleted"]:
print(old_source["is_deleted"]) print(old_source["is_deleted"])
print(new_source["is_deleted"]) print(new_source["is_deleted"])
......
...@@ -48,6 +48,7 @@ class ESPerform(object): ...@@ -48,6 +48,7 @@ class ESPerform(object):
:return: :return:
""" """
try: try:
index_flag = None
assert (index_flag in [None, "read", "write"]) assert (index_flag in [None, "read", "write"])
official_index_name = cls.index_prefix + "-" + sub_index_name official_index_name = cls.index_prefix + "-" + sub_index_name
...@@ -191,8 +192,8 @@ class ESPerform(object): ...@@ -191,8 +192,8 @@ class ESPerform(object):
try: try:
assert (es_cli is not None) assert (es_cli is not None)
official_index_name = sub_index_name official_index_name = sub_index_name
# if sub_index_name != "mv-alpha-user-test-190711901": if sub_index_name != "mv-alpha-user-test-190711901":
# official_index_name = cls.get_official_index_name(sub_index_name, "read") official_index_name = cls.get_official_index_name(sub_index_name, "read")
index_exists = es_cli.indices.exists(official_index_name) index_exists = es_cli.indices.exists(official_index_name)
if not index_exists: if not index_exists:
...@@ -237,7 +238,7 @@ class ESPerform(object): ...@@ -237,7 +238,7 @@ class ESPerform(object):
try: try:
assert (es_cli is not None) assert (es_cli is not None)
# official_index_name = cls.get_official_index_name(sub_index_name, "read") official_index_name = cls.get_official_index_name(sub_index_name, "read")
index_exists = es_cli.indices.exists(sub_index_name) index_exists = es_cli.indices.exists(sub_index_name)
if not index_exists: if not index_exists:
logging.error("index:%s is not existing,get_search_results error!" % sub_index_name) logging.error("index:%s is not existing,get_search_results error!" % sub_index_name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment