Commit 11636385 authored by lixiaofang's avatar lixiaofang

add

parent 66ffbe75
This diff is collapsed.
......@@ -48,6 +48,7 @@ class ESPerform(object):
:return:
"""
try:
index_flag = None
assert (index_flag in [None, "read", "write"])
official_index_name = cls.index_prefix + "-" + sub_index_name
......@@ -191,8 +192,8 @@ class ESPerform(object):
try:
assert (es_cli is not None)
official_index_name = sub_index_name
# if sub_index_name != "mv-alpha-user-test-190711901":
# official_index_name = cls.get_official_index_name(sub_index_name, "read")
if sub_index_name != "mv-alpha-toipc-test-1907129011":
official_index_name = cls.get_official_index_name(sub_index_name, "read")
index_exists = es_cli.indices.exists(official_index_name)
if not index_exists:
......
......@@ -18,6 +18,7 @@ ES_INFO_LIST = [
]
ES_INDEX_PREFIX = "gm-dbmw"
class ESPerform(object):
cli_obj = None
cli_info_list = ES_INFO_LIST
......@@ -46,6 +47,7 @@ class ESPerform(object):
:return:
"""
try:
index_flag = None
assert (index_flag in [None, "read", "write"])
official_index_name = cls.index_prefix + "-" + sub_index_name
......@@ -283,6 +285,7 @@ class ESPerform(object):
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return True
# 先获取一部分数据
es_cli_obj = ESPerform.get_cli()
......@@ -362,12 +365,11 @@ for old_item in result_dict["hits"]:
is_deleted = values["is_deleted"]
if is_online != new_source["suggest"]["contexts"]["is_online"]:
print(is_online)
print ("----is_online--------")
print("----is_online--------")
if is_deleted != new_source["suggest"]["contexts"]["is_deleted"]:
print(is_deleted)
print("-------is_deleted---------")
if old_source["is_deleted"] != new_source["is_deleted"]:
print(old_source["is_deleted"])
print(new_source["is_deleted"])
......
......@@ -48,6 +48,7 @@ class ESPerform(object):
:return:
"""
try:
index_flag = None
assert (index_flag in [None, "read", "write"])
official_index_name = cls.index_prefix + "-" + sub_index_name
......@@ -191,8 +192,8 @@ class ESPerform(object):
try:
assert (es_cli is not None)
official_index_name = sub_index_name
# if sub_index_name != "mv-alpha-user-test-190711901":
# official_index_name = cls.get_official_index_name(sub_index_name, "read")
if sub_index_name != "mv-alpha-user-test-190711901":
official_index_name = cls.get_official_index_name(sub_index_name, "read")
index_exists = es_cli.indices.exists(official_index_name)
if not index_exists:
......@@ -237,7 +238,7 @@ class ESPerform(object):
try:
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)
if not index_exists:
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