Commit 8974d9c9 authored by 李小芳's avatar 李小芳

更新代码

parent 6d298f32
...@@ -188,6 +188,6 @@ def get_es_instance(): ...@@ -188,6 +188,6 @@ def get_es_instance():
'sniff_on_start': False, 'sniff_on_start': False,
'sniff_on_connection_fail': False, 'sniff_on_connection_fail': False,
} }
new_hosts = settings.ES_HOSTS new_hosts = settings.ES7_HOSTS
__es_instance = Elasticsearch(hosts=new_hosts, **init_args) __es_instance = Elasticsearch(hosts=new_hosts, **init_args)
return __es_instance return __es_instance
...@@ -64,7 +64,7 @@ def get_es(es_hosts_config=None): ...@@ -64,7 +64,7 @@ def get_es(es_hosts_config=None):
'sniff_on_start': False, 'sniff_on_start': False,
'sniff_on_connection_fail': False, 'sniff_on_connection_fail': False,
} }
new_hosts = settings.ES_V2_HOSTS if not es_hosts_config else es_hosts_config new_hosts = settings.ES7_HOSTS if not es_hosts_config else es_hosts_config
new_es = Es(hosts=new_hosts, **init_args) new_es = Es(hosts=new_hosts, **init_args)
return new_es return new_es
...@@ -84,7 +84,7 @@ def es_query(doc, body, offset, size, es=None): ...@@ -84,7 +84,7 @@ def es_query(doc, body, offset, size, es=None):
es = get_es() es = get_es()
index = es_index_adapt( index = es_index_adapt(
index_prefix=settings.ES_INDEX_PREFIX, index_prefix=settings.ES7_HOSTS,
doc_type=doc, doc_type=doc,
rw='read' rw='read'
) )
...@@ -92,7 +92,7 @@ def es_query(doc, body, offset, size, es=None): ...@@ -92,7 +92,7 @@ def es_query(doc, body, offset, size, es=None):
res = es.search( res = es.search(
index=index, index=index,
doc_type=doc, doc_type=doc,
timeout=settings.ES_SEARCH_TIMEOUT, timeout=settings.ES7_HOSTS,
body=body, body=body,
from_=offset, from_=offset,
size=size) size=size)
......
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