|
@@ -63,6 +63,15 @@ class SearchABTest(object):
|
|
|
info="通过baidu搜索失败---{}".format(cls.ori_title),
|
|
|
trace_id=cls.trace_id,
|
|
|
)
|
|
|
+ xigua_result = xigua_search(keyword=cls.ori_title)
|
|
|
+ if xigua_result:
|
|
|
+ return {"platform": "xg_search", "result": xigua_result[0]}
|
|
|
+ else:
|
|
|
+ logging(
|
|
|
+ code="7001",
|
|
|
+ info="通过西瓜搜索失败---{}".format(cls.ori_title),
|
|
|
+ trace_id=cls.trace_id,
|
|
|
+ )
|
|
|
return None
|
|
|
|
|
|
@classmethod
|
|
@@ -90,6 +99,15 @@ class SearchABTest(object):
|
|
|
info="通过baidu搜索失败---{}".format(cls.article_summary),
|
|
|
trace_id=cls.trace_id,
|
|
|
)
|
|
|
+ xigua_result = xigua_search(keyword=cls.article_summary)
|
|
|
+ if xigua_result:
|
|
|
+ return {"platform": "xg_search", "result": xigua_result[0]}
|
|
|
+ else:
|
|
|
+ logging(
|
|
|
+ code="7001",
|
|
|
+ info="通过西瓜搜索失败---{}".format(cls.article_summary),
|
|
|
+ trace_id=cls.trace_id,
|
|
|
+ )
|
|
|
return None
|
|
|
|
|
|
@classmethod
|
|
@@ -118,6 +136,15 @@ class SearchABTest(object):
|
|
|
info="通过baidu搜索失败---{}".format(",".join(cls.article_keys)),
|
|
|
trace_id=cls.trace_id,
|
|
|
)
|
|
|
+ xigua_result = xigua_search(keyword=",".join(cls.article_keys))
|
|
|
+ if xigua_result:
|
|
|
+ return {"platform": "xg_search", "result": xigua_result[0]}
|
|
|
+ else:
|
|
|
+ logging(
|
|
|
+ code="7001",
|
|
|
+ info="通过西瓜搜索失败---{}".format(",".join(cls.article_keys)),
|
|
|
+ trace_id=cls.trace_id,
|
|
|
+ )
|
|
|
return None
|
|
|
|
|
|
@classmethod
|