|
@@ -51,7 +51,7 @@ def object_id(_id: str):
|
|
def es_client(cfg=None):
|
|
def es_client(cfg=None):
|
|
if cfg is None:
|
|
if cfg is None:
|
|
cfg = es_conf
|
|
cfg = es_conf
|
|
- return Elasticsearch([{"host": cfg['host'], "port": cfg['port']}])
|
|
|
|
|
|
+ return Elasticsearch([{"host": cfg['host'], "port": cfg['port']}],http_auth=(cfg['usename'], cfg['pwd']))
|
|
|
|
|
|
|
|
|
|
def es_query(title: str, publish_time: int):
|
|
def es_query(title: str, publish_time: int):
|