Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
search_tips
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
0
Merge Requests
0
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
search_tips
Commits
79bb15a3
Commit
79bb15a3
authored
Jan 28, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into 'master'
modify settings See merge request
!2
parents
8e7b74b8
6a028a47
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
69 additions
and
80 deletions
+69
-80
settings.py
search_tips/settings.py
+2
-51
settings_local.py
search_tips/settings_local.py
+59
-0
brandwiki_transfer.py
trans2es/utils/brandwiki_transfer.py
+0
-4
collectwiki_transfer.py
trans2es/utils/collectwiki_transfer.py
+0
-4
doctor_transfer.py
trans2es/utils/doctor_transfer.py
+3
-4
hospital_transfer.py
trans2es/utils/hospital_transfer.py
+0
-4
itemwiki_transfer.py
trans2es/utils/itemwiki_transfer.py
+3
-5
productwiki_transfer.py
trans2es/utils/productwiki_transfer.py
+0
-4
tag_transfer.py
trans2es/utils/tag_transfer.py
+2
-4
No files found.
search_tips/settings.py
View file @
79bb15a3
...
@@ -14,6 +14,7 @@ import os
...
@@ -14,6 +14,7 @@ import os
from
.log_settings
import
*
from
.log_settings
import
*
from
datetime
import
timedelta
from
datetime
import
timedelta
from
celery.schedules
import
crontab
from
celery.schedules
import
crontab
from
.settings_local
import
*
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
...
@@ -23,15 +24,10 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
...
@@ -23,15 +24,10 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
'e
%
$v6snev0807=t0@gk_n2#r5m6r1h(eil6cp^y3ub@ja@gk_t'
# SECURITY WARNING: don't run with debug turned on in production!
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
DEBUG
=
True
ALLOWED_HOSTS
=
[
"192.168.78.2"
]
SENTRY_CELERY_ENDPOINT
=
"http://60b0004c8884420f8067fb32fc3ed244:20f97fc73ffa4aad9735d0e6542a6d78@sentry.igengmei.com/140"
BROKER_URL
=
"redis://127.0.0.1:6379/8"
# CELERY_SEND_EVENTS = True
# CELERY_SEND_EVENTS = True
# CELERY_SEND_TASK_SENT_EVENT = True
# CELERY_SEND_TASK_SENT_EVENT = True
...
@@ -51,9 +47,6 @@ BROKER_URL = "redis://127.0.0.1:6379/8"
...
@@ -51,9 +47,6 @@ BROKER_URL = "redis://127.0.0.1:6379/8"
# },
# },
# }
# }
REDIS_URL
=
"redis://127.0.0.1:6379"
CELERY_BROKER_URL
=
"redis://127.0.0.1:6379/8"
CELERY_TIMEZONE
=
'Asia/Shanghai'
CELERY_TIMEZONE
=
'Asia/Shanghai'
CELERY_ROUTES
=
[
'physical.celery_task_router.CeleryTaskRouter'
]
CELERY_ROUTES
=
[
'physical.celery_task_router.CeleryTaskRouter'
]
...
@@ -66,7 +59,7 @@ INSTALLED_APPS = [
...
@@ -66,7 +59,7 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'django.contrib.staticfiles'
,
'trans2es'
,
'trans2es'
,
'search'
'search'
]
]
...
@@ -101,48 +94,6 @@ TEMPLATES = [
...
@@ -101,48 +94,6 @@ TEMPLATES = [
WSGI_APPLICATION
=
'search_tips.wsgi.application'
WSGI_APPLICATION
=
'search_tips.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.mysql'
,
'NAME'
:
'zhengxing_test'
,
'USER'
:
'work'
,
'PASSWORD'
:
'workwork'
,
'HOST'
:
'rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com'
,
'PORT'
:
''
,
'OPTIONS'
:
{
"init_command"
:
"SET foreign_key_checks = 0;"
,
"charset"
:
"utf8mb4"
,
}
},
'bran'
:
{
'ENGINE'
:
'django.db.backends.mysql'
,
# 设置为mysql数据库
'NAME'
:
'bran_test'
,
'USER'
:
'work'
,
'PASSWORD'
:
'workwork'
,
'HOST'
:
'rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com'
,
'PORT'
:
'3306'
,
'OPTIONS'
:
{
"init_command"
:
"SET foreign_key_checks = 0;"
,
"charset"
:
"utf8mb4"
,
# 为了支持emoji表情
},
}
}
ES_INFO_LIST
=
[
{
"host"
:
"10.29.130.141"
,
"port"
:
9200
}
]
ES_INDEX_PREFIX
=
"gm-dbmw"
# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS
=
[
AUTH_PASSWORD_VALIDATORS
=
[
{
{
'NAME'
:
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'
,
'NAME'
:
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'
,
...
...
search_tips/settings_local.py
0 → 100644
View file @
79bb15a3
# -*- coding:utf-8 -*-
ALLOWED_HOSTS
=
[
"192.168.78.2"
]
SECRET_KEY
=
'e
%
$v6snev0807=t0@gk_n2#r5m6r1h(eil6cp^y3ub@ja@gk_t'
SENTRY_CELERY_ENDPOINT
=
"http://60b0004c8884420f8067fb32fc3ed244:20f97fc73ffa4aad9735d0e6542a6d78@sentry.igengmei.com/140"
BROKER_URL
=
"redis://127.0.0.1:6379/8"
REDIS_URL
=
"redis://127.0.0.1:6379"
CELERY_BROKER_URL
=
"redis://127.0.0.1:6379/8"
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.mysql'
,
'NAME'
:
'zhengxing_test'
,
'USER'
:
'work'
,
'PASSWORD'
:
'workwork'
,
'HOST'
:
'rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com'
,
'PORT'
:
''
,
'OPTIONS'
:
{
"init_command"
:
"SET foreign_key_checks = 0;"
,
"charset"
:
"utf8mb4"
,
}
},
'bran'
:
{
'ENGINE'
:
'django.db.backends.mysql'
,
# 设置为mysql数据库
'NAME'
:
'bran_test'
,
'USER'
:
'work'
,
'PASSWORD'
:
'workwork'
,
'HOST'
:
'rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com'
,
'PORT'
:
'3306'
,
'OPTIONS'
:
{
"init_command"
:
"SET foreign_key_checks = 0;"
,
"charset"
:
"utf8mb4"
,
# 为了支持emoji表情
},
}
}
ES_INFO_LIST
=
[
{
"host"
:
"10.29.130.141"
,
"port"
:
9200
}
]
GM_ORI_ES_INFO_LIST
=
[
{
"host"
:
"10.29.130.141"
,
"port"
:
9200
}
]
ES_INDEX_PREFIX
=
"gm-dbmw"
trans2es/utils/brandwiki_transfer.py
View file @
79bb15a3
...
@@ -15,10 +15,6 @@ from trans2es.commons.words_utils import QueryWordAttr
...
@@ -15,10 +15,6 @@ from trans2es.commons.words_utils import QueryWordAttr
class
BrandWikiTransfer
(
object
):
class
BrandWikiTransfer
(
object
):
test_es_info_list
=
[
{
'host'
:
'10.30.57.94'
,
'port'
:
9200
}
]
@classmethod
@classmethod
def
get_brandwiki_suggest_data_list
(
cls
,
instance
):
def
get_brandwiki_suggest_data_list
(
cls
,
instance
):
try
:
try
:
...
...
trans2es/utils/collectwiki_transfer.py
View file @
79bb15a3
...
@@ -15,10 +15,6 @@ from trans2es.commons.words_utils import QueryWordAttr
...
@@ -15,10 +15,6 @@ from trans2es.commons.words_utils import QueryWordAttr
class
CollectWikiTransfer
(
object
):
class
CollectWikiTransfer
(
object
):
test_es_info_list
=
[
{
'host'
:
'10.30.57.94'
,
'port'
:
9200
}
]
@classmethod
@classmethod
def
get_collectwiki_suggest_data_list
(
cls
,
instance
):
def
get_collectwiki_suggest_data_list
(
cls
,
instance
):
try
:
try
:
...
...
trans2es/utils/doctor_transfer.py
View file @
79bb15a3
...
@@ -8,15 +8,14 @@ from libs.tools import tzlc,getMd5Digest
...
@@ -8,15 +8,14 @@ from libs.tools import tzlc,getMd5Digest
from
libs.es
import
ESPerform
from
libs.es
import
ESPerform
from
libs.cache
import
redis_client
from
libs.cache
import
redis_client
import
json
import
json
from
django.conf
import
settings
from
trans2es.commons.commons
import
get_tips_suggest_list
from
trans2es.commons.commons
import
get_tips_suggest_list
from
trans2es.commons.words_utils
import
QueryWordAttr
from
trans2es.commons.words_utils
import
QueryWordAttr
class
DoctorTransfer
(
object
):
class
DoctorTransfer
(
object
):
test_es_info_list
=
[
{
'host'
:
'10.30.57.94'
,
'port'
:
9200
}
]
@classmethod
@classmethod
def
get_doctor_data_name_mapping_results_to_redis
(
cls
,
instance
):
def
get_doctor_data_name_mapping_results_to_redis
(
cls
,
instance
):
try
:
try
:
...
@@ -53,7 +52,7 @@ class DoctorTransfer(object):
...
@@ -53,7 +52,7 @@ class DoctorTransfer(object):
}
}
}
}
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(
cls
.
test_es_info_list
),
sub_index_name
=
"doctor"
,
doc_type
=
"doctor"
,
query_body
=
q
,
offset
=
0
,
size
=
0
)
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(
settings
.
GM_ORI_ES_INFO_LIST
),
sub_index_name
=
"doctor"
,
doc_type
=
"doctor"
,
query_body
=
q
,
offset
=
0
,
size
=
0
)
doctor_results
=
result_dict
[
"total_count"
]
doctor_results
=
result_dict
[
"total_count"
]
...
...
trans2es/utils/hospital_transfer.py
View file @
79bb15a3
...
@@ -14,10 +14,6 @@ from trans2es.commons.words_utils import QueryWordAttr
...
@@ -14,10 +14,6 @@ from trans2es.commons.words_utils import QueryWordAttr
class
HospitalTransfer
(
object
):
class
HospitalTransfer
(
object
):
test_es_info_list
=
[
{
'host'
:
'10.30.57.94'
,
'port'
:
9200
}
]
@classmethod
@classmethod
def
get_hospital_suggest_data_list
(
cls
,
instance
):
def
get_hospital_suggest_data_list
(
cls
,
instance
):
try
:
try
:
...
...
trans2es/utils/itemwiki_transfer.py
View file @
79bb15a3
...
@@ -8,6 +8,8 @@ from libs.tools import tzlc,getMd5Digest
...
@@ -8,6 +8,8 @@ from libs.tools import tzlc,getMd5Digest
from
libs.es
import
ESPerform
from
libs.es
import
ESPerform
from
libs.cache
import
redis_client
from
libs.cache
import
redis_client
import
json
import
json
from
django.conf
import
settings
from
trans2es.commons.commons
import
get_tips_suggest_list
from
trans2es.commons.commons
import
get_tips_suggest_list
from
trans2es.commons.words_utils
import
QueryWordAttr
from
trans2es.commons.words_utils
import
QueryWordAttr
...
@@ -15,10 +17,6 @@ from trans2es.commons.words_utils import QueryWordAttr
...
@@ -15,10 +17,6 @@ from trans2es.commons.words_utils import QueryWordAttr
class
ItemWikiTransfer
(
object
):
class
ItemWikiTransfer
(
object
):
test_es_info_list
=
[
{
'host'
:
'10.30.57.94'
,
'port'
:
9200
}
]
@classmethod
@classmethod
def
get_wiki_data_name_mapping_results_to_redis
(
cls
,
instance
):
def
get_wiki_data_name_mapping_results_to_redis
(
cls
,
instance
):
try
:
try
:
...
@@ -59,7 +57,7 @@ class ItemWikiTransfer(object):
...
@@ -59,7 +57,7 @@ class ItemWikiTransfer(object):
}
}
}
}
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(
cls
.
test_es_info_list
),
sub_index_name
=
"newwiki"
,
doc_type
=
"newwiki"
,
query_body
=
q
,
offset
=
0
,
size
=
0
)
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(
settings
.
GM_ORI_ES_INFO_LIST
),
sub_index_name
=
"newwiki"
,
doc_type
=
"newwiki"
,
query_body
=
q
,
offset
=
0
,
size
=
0
)
doctor_results
=
result_dict
[
"total_count"
]
doctor_results
=
result_dict
[
"total_count"
]
...
...
trans2es/utils/productwiki_transfer.py
View file @
79bb15a3
...
@@ -15,10 +15,6 @@ from trans2es.commons.words_utils import QueryWordAttr
...
@@ -15,10 +15,6 @@ from trans2es.commons.words_utils import QueryWordAttr
class
ProduceWikiTransfer
(
object
):
class
ProduceWikiTransfer
(
object
):
test_es_info_list
=
[
{
'host'
:
'10.30.57.94'
,
'port'
:
9200
}
]
@classmethod
@classmethod
def
get_productwiki_suggest_data_list
(
cls
,
instance
):
def
get_productwiki_suggest_data_list
(
cls
,
instance
):
try
:
try
:
...
...
trans2es/utils/tag_transfer.py
View file @
79bb15a3
...
@@ -8,6 +8,7 @@ from libs.tools import tzlc,getMd5Digest
...
@@ -8,6 +8,7 @@ from libs.tools import tzlc,getMd5Digest
from
libs.es
import
ESPerform
from
libs.es
import
ESPerform
from
libs.cache
import
redis_client
from
libs.cache
import
redis_client
import
json
import
json
from
django.conf
import
settings
from
trans2es.commons.commons
import
get_tips_suggest_list
from
trans2es.commons.commons
import
get_tips_suggest_list
from
trans2es.commons.words_utils
import
QueryWordAttr
from
trans2es.commons.words_utils
import
QueryWordAttr
...
@@ -15,9 +16,6 @@ from trans2es.commons.words_utils import QueryWordAttr
...
@@ -15,9 +16,6 @@ from trans2es.commons.words_utils import QueryWordAttr
class
TagTransfer
(
object
):
class
TagTransfer
(
object
):
test_es_info_list
=
[
{
'host'
:
'10.30.57.94'
,
'port'
:
9200
}
]
tips_num_redis_key_prefix
=
"search_tips:tips_mapping_num"
tips_num_redis_key_prefix
=
"search_tips:tips_mapping_num"
@classmethod
@classmethod
...
@@ -69,7 +67,7 @@ class TagTransfer(object):
...
@@ -69,7 +67,7 @@ class TagTransfer(object):
}
}
}
}
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(
cls
.
test_es_info_list
),
sub_index_name
=
"service"
,
doc_type
=
"service"
,
query_body
=
q
,
offset
=
0
,
size
=
0
)
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(
settings
.
GM_ORI_ES_INFO_LIST
),
sub_index_name
=
"service"
,
doc_type
=
"service"
,
query_body
=
q
,
offset
=
0
,
size
=
0
)
doctor_results
=
result_dict
[
"total_count"
]
doctor_results
=
result_dict
[
"total_count"
]
...
...
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