Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mentha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
mentha
Commits
8974d9c9
Commit
8974d9c9
authored
Nov 03, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新代码
parent
6d298f32
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
utils.py
data_sync/utils.py
+1
-1
toutiao.py
qa/models/toutiao.py
+3
-3
No files found.
data_sync/utils.py
View file @
8974d9c9
...
...
@@ -188,6 +188,6 @@ def get_es_instance():
'sniff_on_start'
:
False
,
'sniff_on_connection_fail'
:
False
,
}
new_hosts
=
settings
.
ES_HOSTS
new_hosts
=
settings
.
ES
7
_HOSTS
__es_instance
=
Elasticsearch
(
hosts
=
new_hosts
,
**
init_args
)
return
__es_instance
qa/models/toutiao.py
View file @
8974d9c9
...
...
@@ -64,7 +64,7 @@ def get_es(es_hosts_config=None):
'sniff_on_start'
:
False
,
'sniff_on_connection_fail'
:
False
,
}
new_hosts
=
settings
.
ES
_V2
_HOSTS
if
not
es_hosts_config
else
es_hosts_config
new_hosts
=
settings
.
ES
7
_HOSTS
if
not
es_hosts_config
else
es_hosts_config
new_es
=
Es
(
hosts
=
new_hosts
,
**
init_args
)
return
new_es
...
...
@@ -84,7 +84,7 @@ def es_query(doc, body, offset, size, es=None):
es
=
get_es
()
index
=
es_index_adapt
(
index_prefix
=
settings
.
ES
_INDEX_PREFIX
,
index_prefix
=
settings
.
ES
7_HOSTS
,
doc_type
=
doc
,
rw
=
'read'
)
...
...
@@ -92,7 +92,7 @@ def es_query(doc, body, offset, size, es=None):
res
=
es
.
search
(
index
=
index
,
doc_type
=
doc
,
timeout
=
settings
.
ES
_SEARCH_TIMEOUT
,
timeout
=
settings
.
ES
7_HOSTS
,
body
=
body
,
from_
=
offset
,
size
=
size
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment