Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dymas
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
dymas
Commits
219c81c2
Commit
219c81c2
authored
Dec 12, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改url
parent
16af23a3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
98 additions
and
97 deletions
+98
-97
workspace.xml
.idea/workspace.xml
+0
-0
views.py
hera/views.py
+1
-1
tests.py
rank/tests.py
+2
-2
interpose.py
rank/views/interpose.py
+1
-1
stat.py
rank/views/stat.py
+2
-2
strategy.py
rank/views/strategy.py
+1
-1
tests.py
recommend/tests.py
+3
-3
content.py
recommend/views/content.py
+6
-6
detail.py
recommend/views/detail.py
+1
-1
feed.py
recommend/views/feed.py
+1
-1
service.py
recommend/views/service.py
+8
-8
tests.py
search/tests.py
+20
-19
answer.py
search/views/answer.py
+3
-3
article.py
search/views/article.py
+1
-1
board.py
search/views/board.py
+1
-1
content_aggre.py
search/views/content_aggre.py
+5
-5
diary.py
search/views/diary.py
+6
-6
doctor.py
search/views/doctor.py
+1
-1
home_feed.py
search/views/home_feed.py
+2
-2
mind.py
search/views/mind.py
+1
-1
principal_page.py
search/views/principal_page.py
+4
-4
question.py
search/views/question.py
+4
-4
relation_search.py
search/views/relation_search.py
+3
-3
search_comprehensive.py
search/views/search_comprehensive.py
+1
-1
service.py
search/views/service.py
+1
-1
sku.py
search/views/sku.py
+7
-7
spu.py
search/views/spu.py
+1
-1
subscript_article.py
search/views/subscript_article.py
+1
-1
tractate.py
search/views/tractate.py
+5
-5
wiki.py
search/views/wiki.py
+2
-2
wiki_keyword.py
search/views/wiki_keyword.py
+1
-1
wikitab.py
search/views/wikitab.py
+2
-2
No files found.
.idea/workspace.xml
View file @
219c81c2
This diff is collapsed.
Click to expand it.
hera/views.py
View file @
219c81c2
...
@@ -4,7 +4,7 @@ from libs.rpc import get_rpc_invoker
...
@@ -4,7 +4,7 @@ from libs.rpc import get_rpc_invoker
from
hera.models.city_rank
import
CityWhiteList
from
hera.models.city_rank
import
CityWhiteList
@bind
(
'd
ori
s/hera/in_city_whitelist'
)
@bind
(
'd
yma
s/hera/in_city_whitelist'
)
def
city_is_in_whitelist
(
city_ids
):
def
city_is_in_whitelist
(
city_ids
):
rs
=
[]
rs
=
[]
if
not
city_ids
:
if
not
city_ids
:
...
...
rank/tests.py
View file @
219c81c2
...
@@ -12,12 +12,12 @@ class RankTestCase(DorisTestCase):
...
@@ -12,12 +12,12 @@ class RankTestCase(DorisTestCase):
params
=
{
params
=
{
"strategy_name"
:
STRATEGY_TYPE
.
SERVICE_SEARCH
"strategy_name"
:
STRATEGY_TYPE
.
SERVICE_SEARCH
}
}
resp
=
self
.
call
(
"d
ori
s/strategy/get"
,
params
)
resp
=
self
.
call
(
"d
yma
s/strategy/get"
,
params
)
self
.
assertDictEqual
(
resp
.
result
,{
'a'
:
12
,
'b'
:
3
,
'c'
:
1
,
'd'
:
5
,
'e'
:
3
})
self
.
assertDictEqual
(
resp
.
result
,{
'a'
:
12
,
'b'
:
3
,
'c'
:
1
,
'd'
:
5
,
'e'
:
3
})
def
test_get_wrong_strategy
(
self
):
def
test_get_wrong_strategy
(
self
):
params
=
{
params
=
{
"strategy_name"
:
'test'
"strategy_name"
:
'test'
}
}
resp
=
self
.
call
(
"d
ori
s/strategy/get"
,
params
)
resp
=
self
.
call
(
"d
yma
s/strategy/get"
,
params
)
self
.
assertEqual
(
resp
.
code
,
ERROR
.
UNSUPPORT_STRATEGY_TYPE
)
self
.
assertEqual
(
resp
.
code
,
ERROR
.
UNSUPPORT_STRATEGY_TYPE
)
rank/views/interpose.py
View file @
219c81c2
...
@@ -8,7 +8,7 @@ from rank.models import Interpose
...
@@ -8,7 +8,7 @@ from rank.models import Interpose
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
@bind
(
'd
ori
s/interpose/get'
)
@bind
(
'd
yma
s/interpose/get'
)
def
get_interpose_strategy
(
interpose_type
,
city_tag_id
,
tag_id
,
sort_order
,
keyword
=
None
):
def
get_interpose_strategy
(
interpose_type
,
city_tag_id
,
tag_id
,
sort_order
,
keyword
=
None
):
tag_ids
=
[
0
]
tag_ids
=
[
0
]
city_tag_ids
=
[
0
]
city_tag_ids
=
[
0
]
...
...
rank/views/stat.py
View file @
219c81c2
...
@@ -7,7 +7,7 @@ from libs.types import ensure_str
...
@@ -7,7 +7,7 @@ from libs.types import ensure_str
from
recommend.models
import
ServiceHot
from
recommend.models
import
ServiceHot
from
libs.cache
import
redis_client
as
service_hot_redis_client
from
libs.cache
import
redis_client
as
service_hot_redis_client
@bind
(
'd
ori
s/stat/doctor'
)
@bind
(
'd
yma
s/stat/doctor'
)
def
doris_stat_doctor
(
doctor_id
):
def
doris_stat_doctor
(
doctor_id
):
redis_key
=
"doctor:{}"
.
format
(
doctor_id
)
redis_key
=
"doctor:{}"
.
format
(
doctor_id
)
stat_json
=
redis_client
.
get
(
redis_key
)
stat_json
=
redis_client
.
get
(
redis_key
)
...
@@ -23,7 +23,7 @@ def doris_stat_doctor(doctor_id):
...
@@ -23,7 +23,7 @@ def doris_stat_doctor(doctor_id):
# @rd 郑伟
# @rd 郑伟
# @param service_id 美购id
# @param service_id 美购id
# @date 20170620
# @date 20170620
@bind
(
"d
ori
s/stat/service"
)
@bind
(
"d
yma
s/stat/service"
)
def
doris_stat_service
(
service_id
):
def
doris_stat_service
(
service_id
):
redis_key
=
ServiceHot
.
get_stat_key
(
service_id
)
redis_key
=
ServiceHot
.
get_stat_key
(
service_id
)
stat_json
=
service_hot_redis_client
.
get
(
redis_key
)
stat_json
=
service_hot_redis_client
.
get
(
redis_key
)
...
...
rank/views/strategy.py
View file @
219c81c2
...
@@ -12,7 +12,7 @@ ALLOW_STRATEGY = [
...
@@ -12,7 +12,7 @@ ALLOW_STRATEGY = [
]
]
@bind
(
'd
ori
s/strategy/get'
)
@bind
(
'd
yma
s/strategy/get'
)
def
get_doris_strategy
(
strategy_name
=
None
):
def
get_doris_strategy
(
strategy_name
=
None
):
if
strategy_name
is
None
:
if
strategy_name
is
None
:
return
{}
return
{}
...
...
recommend/tests.py
View file @
219c81c2
...
@@ -10,7 +10,7 @@ class RecommandTestCase(DorisTestCase):
...
@@ -10,7 +10,7 @@ class RecommandTestCase(DorisTestCase):
params
=
{
params
=
{
"device_id"
:
"aaa"
"device_id"
:
"aaa"
}
}
resp
=
self
.
call
(
"d
ori
s/recommend/service"
,
params
)
resp
=
self
.
call
(
"d
yma
s/recommend/service"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_get_hot_service_by_tags
(
self
):
def
test_get_hot_service_by_tags
(
self
):
...
@@ -20,13 +20,13 @@ class RecommandTestCase(DorisTestCase):
...
@@ -20,13 +20,13 @@ class RecommandTestCase(DorisTestCase):
params
=
{
params
=
{
"device_id"
:
"aaa"
"device_id"
:
"aaa"
}
}
resp
=
self
.
call
(
"d
ori
s/recommend/interest_tag"
,
params
)
resp
=
self
.
call
(
"d
yma
s/recommend/interest_tag"
,
params
)
def
test_tobuy_service
(
self
):
def
test_tobuy_service
(
self
):
params
=
{
params
=
{
"device_id"
:
"56D5E838-470E-42BB-87E1-FA07C47FC390"
"device_id"
:
"56D5E838-470E-42BB-87E1-FA07C47FC390"
}
}
resp
=
self
.
call
(
"d
ori
s/willbuy/service"
,
params
)
resp
=
self
.
call
(
"d
yma
s/willbuy/service"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
...
...
recommend/views/content.py
View file @
219c81c2
...
@@ -54,7 +54,7 @@ MAX_LOAD = 200
...
@@ -54,7 +54,7 @@ MAX_LOAD = 200
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
@bind
(
"d
ori
s/recommend/get_diaries"
)
@bind
(
"d
yma
s/recommend/get_diaries"
)
def
get_diaries
(
tags
,
city
,
offset
=
0
,
size
=
10
,
city_tag_id
=
None
):
def
get_diaries
(
tags
,
city
,
offset
=
0
,
size
=
10
,
city_tag_id
=
None
):
# NOTE: city as city id
# NOTE: city as city id
sort_params
=
{}
sort_params
=
{}
...
@@ -94,7 +94,7 @@ def get_diaries(tags, city, offset=0, size=10, city_tag_id=None):
...
@@ -94,7 +94,7 @@ def get_diaries(tags, city, offset=0, size=10, city_tag_id=None):
return
{
"diaries_ids"
:
diaries_ids
}
return
{
"diaries_ids"
:
diaries_ids
}
@bind
(
"d
ori
s/recommend/get_articles"
)
@bind
(
"d
yma
s/recommend/get_articles"
)
def
get_articles
(
tags
,
offset
=
0
,
size
=
10
):
def
get_articles
(
tags
,
offset
=
0
,
size
=
10
):
filters
=
{
filters
=
{
"content_level"
:
[
CONTENT_CLASS
.
EXCELLENT
,
CONTENT_CLASS
.
FINE
]
"content_level"
:
[
CONTENT_CLASS
.
EXCELLENT
,
CONTENT_CLASS
.
FINE
]
...
@@ -107,7 +107,7 @@ def get_articles(tags, offset=0, size=10):
...
@@ -107,7 +107,7 @@ def get_articles(tags, offset=0, size=10):
return
{
"article_ids"
:
article_ids
}
return
{
"article_ids"
:
article_ids
}
@bind
(
"d
ori
s/recommend/get_answers"
)
@bind
(
"d
yma
s/recommend/get_answers"
)
def
get_answers
(
tags
,
offset
=
0
,
size
=
10
):
def
get_answers
(
tags
,
offset
=
0
,
size
=
10
):
filters
=
{
filters
=
{
"content_level"
:
[
CONTENT_CLASS
.
EXCELLENT
,
CONTENT_CLASS
.
FINE
]
"content_level"
:
[
CONTENT_CLASS
.
EXCELLENT
,
CONTENT_CLASS
.
FINE
]
...
@@ -129,7 +129,7 @@ def get_answers(tags, offset=0, size=10):
...
@@ -129,7 +129,7 @@ def get_answers(tags, offset=0, size=10):
answer_ids
=
[
answer
[
'id'
]
for
answer
in
answers
]
answer_ids
=
[
answer
[
'id'
]
for
answer
in
answers
]
return
{
"answer_ids"
:
answer_ids
}
return
{
"answer_ids"
:
answer_ids
}
@bind
(
'
doris
/recommend/icon'
)
@bind
(
'
v
/recommend/icon'
)
def
fetch_icon
(
device_id
,
size
):
def
fetch_icon
(
device_id
,
size
):
try
:
try
:
card_type
=
"icon"
card_type
=
"icon"
...
@@ -151,7 +151,7 @@ def fetch_icon(device_id, size):
...
@@ -151,7 +151,7 @@ def fetch_icon(device_id, size):
logging_exception
()
logging_exception
()
return
{
"icon"
:
[]}
return
{
"icon"
:
[]}
@bind
(
'd
ori
s/recommend/homepage_polymer'
)
@bind
(
'd
yma
s/recommend/homepage_polymer'
)
def
fetch_polymer_ids
(
device_id
,
size
):
def
fetch_polymer_ids
(
device_id
,
size
):
try
:
try
:
card_type
=
"polymer_ids"
card_type
=
"polymer_ids"
...
@@ -173,7 +173,7 @@ def fetch_polymer_ids(device_id, size):
...
@@ -173,7 +173,7 @@ def fetch_polymer_ids(device_id, size):
logging_exception
()
logging_exception
()
return
{
"polymer_ids"
:
[]}
return
{
"polymer_ids"
:
[]}
@bind
(
'd
ori
s/recommend/feed'
)
@bind
(
'd
yma
s/recommend/feed'
)
def
recommend_feed
(
device_id
,
card_type
,
city_id
,
size
):
def
recommend_feed
(
device_id
,
card_type
,
city_id
,
size
):
try
:
try
:
return
RecommendFeed
.
dispatch
(
device_id
,
card_type
,
return
RecommendFeed
.
dispatch
(
device_id
,
card_type
,
...
...
recommend/views/detail.py
View file @
219c81c2
...
@@ -25,7 +25,7 @@ MAX_LOAD = 200
...
@@ -25,7 +25,7 @@ MAX_LOAD = 200
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
@bind
(
"d
ori
s/recommend/content_detail_tag"
)
@bind
(
"d
yma
s/recommend/content_detail_tag"
)
def
content_detail_tag
(
tag
=
{},
page
=
1
,
city_id
=
None
,
city_tag_id
=-
1
,
def
content_detail_tag
(
tag
=
{},
page
=
1
,
city_id
=
None
,
city_tag_id
=-
1
,
device_id
=
None
,
card_type
=
"diary"
,
card_id
=-
1
):
device_id
=
None
,
card_type
=
"diary"
,
card_id
=-
1
):
"""
"""
...
...
recommend/views/feed.py
View file @
219c81c2
...
@@ -38,7 +38,7 @@ def get_gm_kv_ins(redis_ip, redis_port, redis_db,redis_password=""):
...
@@ -38,7 +38,7 @@ def get_gm_kv_ins(redis_ip, redis_port, redis_db,redis_password=""):
return
None
return
None
@bind
(
"d
ori
s/recommend/user_portrait"
)
@bind
(
"d
yma
s/recommend/user_portrait"
)
def
get_user_portrait
(
device_id
):
def
get_user_portrait
(
device_id
):
try
:
try
:
gm_kv_ins
=
None
gm_kv_ins
=
None
...
...
recommend/views/service.py
View file @
219c81c2
...
@@ -55,7 +55,7 @@ def get_willbuy_tags(device_id):
...
@@ -55,7 +55,7 @@ def get_willbuy_tags(device_id):
# @param current_city_tag_id 用户美购首页选择城市tag_id
# @param current_city_tag_id 用户美购首页选择城市tag_id
# @param size 一次推荐多少条美购
# @param size 一次推荐多少条美购
# @date 20170616
# @date 20170616
@bind
(
'd
ori
s/recommend/service'
)
@bind
(
'd
yma
s/recommend/service'
)
def
recommend_service
(
device_id
,
current_city_tag_id
=
None
,
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
offset
=
0
,
def
recommend_service
(
device_id
,
current_city_tag_id
=
None
,
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
offset
=
0
,
size
=
10
):
size
=
10
):
"""
"""
...
@@ -96,13 +96,13 @@ def recommend_service(device_id, current_city_tag_id=None, sort_type=SERVICE_ORD
...
@@ -96,13 +96,13 @@ def recommend_service(device_id, current_city_tag_id=None, sort_type=SERVICE_ORD
return
{
"service_ids"
:
service_ids
}
return
{
"service_ids"
:
service_ids
}
@bind
(
"d
ori
s/recommend/interest_tag"
)
@bind
(
"d
yma
s/recommend/interest_tag"
)
def
get_recommend_interest_tag
(
device_id
):
def
get_recommend_interest_tag
(
device_id
):
interest_tags
=
get_device_interest
(
device_id
)
interest_tags
=
get_device_interest
(
device_id
)
return
{
"interest_tags"
:
interest_tags
}
return
{
"interest_tags"
:
interest_tags
}
@bind
(
"d
ori
s/willbuy/service"
)
@bind
(
"d
yma
s/willbuy/service"
)
def
tobuy_service
(
device_id
,
current_city_tag_id
=
None
,
offset
=
0
,
size
=
40
):
def
tobuy_service
(
device_id
,
current_city_tag_id
=
None
,
offset
=
0
,
size
=
40
):
tobuy_tags
=
get_willbuy_tags
(
device_id
)
tobuy_tags
=
get_willbuy_tags
(
device_id
)
service_ids
=
get_hot_service_by_tags
(
tobuy_tags
,
area_tag_id
=
current_city_tag_id
,
offset
=
offset
,
size
=
size
)
service_ids
=
get_hot_service_by_tags
(
tobuy_tags
,
area_tag_id
=
current_city_tag_id
,
offset
=
offset
,
size
=
size
)
...
@@ -397,7 +397,7 @@ def supplement_service_ids(user_city_tag_id, in_whitelist, had_read_service_list
...
@@ -397,7 +397,7 @@ def supplement_service_ids(user_city_tag_id, in_whitelist, had_read_service_list
return
[]
return
[]
@bind
(
'd
ori
s/recommend/order/service'
)
@bind
(
'd
yma
s/recommend/order/service'
)
def
get_recommend_order_service
(
service_ids
,
query_params
):
def
get_recommend_order_service
(
service_ids
,
query_params
):
# params
# params
try
:
try
:
...
@@ -468,7 +468,7 @@ def get_recommend_order_service(service_ids, query_params):
...
@@ -468,7 +468,7 @@ def get_recommend_order_service(service_ids, query_params):
return
{
"service_ids"
:
res_service_ids
}
return
{
"service_ids"
:
res_service_ids
}
@bind
(
'd
ori
s/recommend/shopcart/service'
)
@bind
(
'd
yma
s/recommend/shopcart/service'
)
def
get_recommend_shopcart_service
(
service_ids
,
query_params
):
def
get_recommend_shopcart_service
(
service_ids
,
query_params
):
try
:
try
:
# params
# params
...
@@ -543,7 +543,7 @@ def get_recommend_shopcart_service(service_ids, query_params):
...
@@ -543,7 +543,7 @@ def get_recommend_shopcart_service(service_ids, query_params):
return
{
"service_ids"
:
res_service_ids
}
return
{
"service_ids"
:
res_service_ids
}
@bind
(
'd
ori
s/recommend/point/service'
)
@bind
(
'd
yma
s/recommend/point/service'
)
def
get_recommend_point_service
(
service_ids
,
query_params
):
def
get_recommend_point_service
(
service_ids
,
query_params
):
try
:
try
:
user_id
=
query_params
[
'user_id'
]
user_id
=
query_params
[
'user_id'
]
...
@@ -620,7 +620,7 @@ def get_recommend_point_service(service_ids, query_params):
...
@@ -620,7 +620,7 @@ def get_recommend_point_service(service_ids, query_params):
# 小程序签到页面美购展示接口
# 小程序签到页面美购展示接口
@bind
(
'd
ori
s/recommend/views/wechat_check_in'
)
@bind
(
'd
yma
s/recommend/views/wechat_check_in'
)
def
wechat_check_in
(
query_params
):
def
wechat_check_in
(
query_params
):
try
:
try
:
user_city_tag_id
=
query_params
[
'user_city_tag_id'
]
user_city_tag_id
=
query_params
[
'user_city_tag_id'
]
...
@@ -643,7 +643,7 @@ def wechat_check_in(query_params):
...
@@ -643,7 +643,7 @@ def wechat_check_in(query_params):
# 美购app签到接口
# 美购app签到接口
@bind
(
'd
ori
s/recommend/views/check_in'
)
@bind
(
'd
yma
s/recommend/views/check_in'
)
def
check_in_service_ids
(
query_params
):
def
check_in_service_ids
(
query_params
):
try
:
try
:
# params
# params
...
...
search/tests.py
View file @
219c81c2
...
@@ -11,7 +11,7 @@ class SearchTestCase(DorisTestCase):
...
@@ -11,7 +11,7 @@ class SearchTestCase(DorisTestCase):
params
=
{
params
=
{
"doctor_id"
:
'bjgmhyy'
"doctor_id"
:
'bjgmhyy'
}
}
resp
=
self
.
call
(
"d
ori
s/search/guess_you_like_service"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/guess_you_like_service"
,
params
)
...
@@ -19,13 +19,13 @@ class SearchTestCase(DorisTestCase):
...
@@ -19,13 +19,13 @@ class SearchTestCase(DorisTestCase):
params
=
{
params
=
{
"tag_id"
:
1682
,
"tag_id"
:
1682
,
}
}
resp
=
self
.
call
(
"d
ori
s/search/guess_you_like_service"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/guess_you_like_service"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_guess_you_like_service
(
self
):
def
test_guess_you_like_service
(
self
):
params
=
{
params
=
{
}
}
resp
=
self
.
call
(
"d
ori
s/search/guess_you_like_service"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/guess_you_like_service"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
...
@@ -33,7 +33,7 @@ class SearchTestCase(DorisTestCase):
...
@@ -33,7 +33,7 @@ class SearchTestCase(DorisTestCase):
"doctor_id"
:
'bjgmhyy'
,
"doctor_id"
:
'bjgmhyy'
,
"tag_id"
:
1682
,
"tag_id"
:
1682
,
}
}
resp
=
self
.
call
(
"d
ori
s/search/guess_you_like_service"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/guess_you_like_service"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
...
@@ -41,18 +41,18 @@ class SearchTestCase(DorisTestCase):
...
@@ -41,18 +41,18 @@ class SearchTestCase(DorisTestCase):
params
=
{
params
=
{
"special_id"
:
309
,
"special_id"
:
309
,
}
}
resp
=
self
.
call
(
"d
ori
s/search/get_diaries_by_special_id"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/get_diaries_by_special_id"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_get_index_diaries
(
self
):
def
test_get_index_diaries
(
self
):
resp
=
self
.
call
(
"d
ori
s/search/get_index_diaries"
)
resp
=
self
.
call
(
"d
yma
s/search/get_index_diaries"
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_get_doctors_by_special_id
(
self
):
def
test_get_doctors_by_special_id
(
self
):
params
=
{
params
=
{
"special_id"
:
491
,
"special_id"
:
491
,
}
}
resp
=
self
.
call
(
"d
ori
s/search/get_doctors_by_special_id"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/get_doctors_by_special_id"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_get_questions_by_tag_id
(
self
):
def
test_get_questions_by_tag_id
(
self
):
...
@@ -60,7 +60,7 @@ class SearchTestCase(DorisTestCase):
...
@@ -60,7 +60,7 @@ class SearchTestCase(DorisTestCase):
"tag_id"
:
87
,
"tag_id"
:
87
,
"sort_type"
:
QUESTION_ORDER_TYPE
.
HOT
"sort_type"
:
QUESTION_ORDER_TYPE
.
HOT
}
}
resp
=
self
.
call
(
"d
ori
s/filter/question"
,
params
)
resp
=
self
.
call
(
"d
yma
s/filter/question"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_get_questions_by_tag_id
(
self
):
def
test_get_questions_by_tag_id
(
self
):
...
@@ -68,7 +68,7 @@ class SearchTestCase(DorisTestCase):
...
@@ -68,7 +68,7 @@ class SearchTestCase(DorisTestCase):
"tag_id"
:
87
,
"tag_id"
:
87
,
"sort_type"
:
QUESTION_ORDER_TYPE
.
UPDATE
"sort_type"
:
QUESTION_ORDER_TYPE
.
UPDATE
}
}
resp
=
self
.
call
(
"d
ori
s/filter/question"
,
params
)
resp
=
self
.
call
(
"d
yma
s/filter/question"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_query_sku_with_cashback
(
self
):
def
test_query_sku_with_cashback
(
self
):
...
@@ -78,14 +78,14 @@ class SearchTestCase(DorisTestCase):
...
@@ -78,14 +78,14 @@ class SearchTestCase(DorisTestCase):
"share_get_cashback"
:
True
"share_get_cashback"
:
True
}
}
}
}
resp
=
self
.
call
(
"d
ori
s/search/query_sku"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/query_sku"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_query_sku
(
self
):
def
test_query_sku
(
self
):
params
=
{
params
=
{
"query"
:
u'北京'
"query"
:
u'北京'
}
}
resp
=
self
.
call
(
"d
ori
s/search/query_sku"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/query_sku"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_query_sku_lowest_price
(
self
):
def
test_query_sku_lowest_price
(
self
):
...
@@ -93,7 +93,7 @@ class SearchTestCase(DorisTestCase):
...
@@ -93,7 +93,7 @@ class SearchTestCase(DorisTestCase):
"query"
:
u'北京'
,
"query"
:
u'北京'
,
"sort_type"
:
SERVICE_ORDER_TYPE
.
ORDER_LOWEST_PRICE
"sort_type"
:
SERVICE_ORDER_TYPE
.
ORDER_LOWEST_PRICE
}
}
resp
=
self
.
call
(
"d
ori
s/search/query_sku"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/query_sku"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
...
@@ -102,7 +102,7 @@ class SearchTestCase(DorisTestCase):
...
@@ -102,7 +102,7 @@ class SearchTestCase(DorisTestCase):
"query"
:
u'北京'
,
"query"
:
u'北京'
,
"sort_type"
:
SERVICE_ORDER_TYPE
.
ORDER_HIGHEST_SALES
"sort_type"
:
SERVICE_ORDER_TYPE
.
ORDER_HIGHEST_SALES
}
}
resp
=
self
.
call
(
"d
ori
s/search/query_sku"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/query_sku"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_query_sku_case_count
(
self
):
def
test_query_sku_case_count
(
self
):
...
@@ -110,7 +110,7 @@ class SearchTestCase(DorisTestCase):
...
@@ -110,7 +110,7 @@ class SearchTestCase(DorisTestCase):
"query"
:
u'北京'
,
"query"
:
u'北京'
,
"sort_type"
:
SERVICE_ORDER_TYPE
.
CASE_COUNT
"sort_type"
:
SERVICE_ORDER_TYPE
.
CASE_COUNT
}
}
resp
=
self
.
call
(
"d
ori
s/search/query_sku"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/query_sku"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_query_sku_order_evaluate
(
self
):
def
test_query_sku_order_evaluate
(
self
):
...
@@ -118,7 +118,7 @@ class SearchTestCase(DorisTestCase):
...
@@ -118,7 +118,7 @@ class SearchTestCase(DorisTestCase):
"query"
:
u'北京'
,
"query"
:
u'北京'
,
"sort_type"
:
SERVICE_ORDER_TYPE
.
ORDER_EVALUATE
"sort_type"
:
SERVICE_ORDER_TYPE
.
ORDER_EVALUATE
}
}
resp
=
self
.
call
(
"d
ori
s/search/query_sku"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/query_sku"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_query_sku_popularity
(
self
):
def
test_query_sku_popularity
(
self
):
...
@@ -126,7 +126,7 @@ class SearchTestCase(DorisTestCase):
...
@@ -126,7 +126,7 @@ class SearchTestCase(DorisTestCase):
"query"
:
u'北京'
,
"query"
:
u'北京'
,
"sort_type"
:
SERVICE_ORDER_TYPE
.
POPULARITY
"sort_type"
:
SERVICE_ORDER_TYPE
.
POPULARITY
}
}
resp
=
self
.
call
(
"d
ori
s/search/query_sku"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/query_sku"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_query_sku_distance
(
self
):
def
test_query_sku_distance
(
self
):
...
@@ -134,7 +134,7 @@ class SearchTestCase(DorisTestCase):
...
@@ -134,7 +134,7 @@ class SearchTestCase(DorisTestCase):
"query"
:
u'北京'
,
"query"
:
u'北京'
,
"sort_type"
:
SERVICE_ORDER_TYPE
.
DISTANCE
"sort_type"
:
SERVICE_ORDER_TYPE
.
DISTANCE
}
}
resp
=
self
.
call
(
"d
ori
s/search/query_sku"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/query_sku"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_query_seckill
(
self
):
def
test_query_seckill
(
self
):
...
@@ -144,7 +144,7 @@ class SearchTestCase(DorisTestCase):
...
@@ -144,7 +144,7 @@ class SearchTestCase(DorisTestCase):
"is_seckill"
:
True
"is_seckill"
:
True
}
}
}
}
resp
=
self
.
call
(
"d
ori
s/search/query_sku"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/query_sku"
,
params
)
self
.
assertEqual
(
resp
.
code
,
0
)
self
.
assertEqual
(
resp
.
code
,
0
)
def
test_recall_board
(
self
):
def
test_recall_board
(
self
):
...
@@ -155,5 +155,5 @@ class SearchTestCase(DorisTestCase):
...
@@ -155,5 +155,5 @@ class SearchTestCase(DorisTestCase):
def
test_recall_boadr_api
(
self
):
def
test_recall_boadr_api
(
self
):
params
=
{
"query"
:
u'医生'
,
"filters"
:{
"city_tag_id"
:
576
}}
params
=
{
"query"
:
u'医生'
,
"filters"
:{
"city_tag_id"
:
576
}}
resp
=
self
.
call
(
"d
ori
s/search/board"
,
params
)
resp
=
self
.
call
(
"d
yma
s/search/board"
,
params
)
print
(
resp
.
result
)
print
(
resp
.
result
)
\ No newline at end of file
search/views/answer.py
View file @
219c81c2
...
@@ -14,7 +14,7 @@ GROUP_SIZE = 10
...
@@ -14,7 +14,7 @@ GROUP_SIZE = 10
variousness_per_10
=
functools
.
partial
(
variousness
,
variety_size
=
GROUP_SIZE
)
variousness_per_10
=
functools
.
partial
(
variousness
,
variety_size
=
GROUP_SIZE
)
@bind
(
"d
ori
s/query/answer"
)
@bind
(
"d
yma
s/query/answer"
)
def
filter_answer
(
query
=
""
,
offset
=
0
,
size
=
10
,
filters
=
{},
sort_type
=
ANSWER_SORT_TYPE
.
DEFAULT
,
sort_params
=
{},
def
filter_answer
(
query
=
""
,
offset
=
0
,
size
=
10
,
filters
=
{},
sort_type
=
ANSWER_SORT_TYPE
.
DEFAULT
,
sort_params
=
{},
have_read_answer_list
=
[]):
have_read_answer_list
=
[]):
logging
.
info
(
"get context:
%
s"
%
context
)
logging
.
info
(
"get context:
%
s"
%
context
)
...
@@ -55,7 +55,7 @@ def filter_answer(query="", offset=0, size=10, filters={}, sort_type=ANSWER_SORT
...
@@ -55,7 +55,7 @@ def filter_answer(query="", offset=0, size=10, filters={}, sort_type=ANSWER_SORT
return
{
"answer_ids"
:
[],
"answer_extra"
:
[]}
return
{
"answer_ids"
:
[],
"answer_extra"
:
[]}
@bind
(
'd
ori
s/search/qa_sort'
)
@bind
(
'd
yma
s/search/qa_sort'
)
def
answer_sort
(
filters
=
None
,
offset
=
0
,
size
=
10
,
use_fresh_tag
=
False
,
device_id
=
''
,
source_type
=-
1
):
def
answer_sort
(
filters
=
None
,
offset
=
0
,
size
=
10
,
use_fresh_tag
=
False
,
device_id
=
''
,
source_type
=-
1
):
try
:
try
:
"""
"""
...
@@ -148,7 +148,7 @@ def answer_sort(filters=None, offset=0, size=10, use_fresh_tag=False, device_id=
...
@@ -148,7 +148,7 @@ def answer_sort(filters=None, offset=0, size=10, use_fresh_tag=False, device_id=
return
{
'answer_id_list'
:
[]}
return
{
'answer_id_list'
:
[]}
@bind
(
'd
ori
s/search/qa_check_in'
)
@bind
(
'd
yma
s/search/qa_check_in'
)
def
qa_check_in
(
device_id
,
size
):
def
qa_check_in
(
device_id
,
size
):
try
:
try
:
key
=
'device_register_qa_queue:'
+
str
(
device_id
)
key
=
'device_register_qa_queue:'
+
str
(
device_id
)
...
...
search/views/article.py
View file @
219c81c2
...
@@ -5,7 +5,7 @@ from search.utils.article import recall_art
...
@@ -5,7 +5,7 @@ from search.utils.article import recall_art
@bind
(
"d
ori
s/query/article"
)
@bind
(
"d
yma
s/query/article"
)
def
filter_article
(
query
,
offset
,
size
,
filters
=
{},
sort_type
=
ARTICLE_SORT_TYPE
.
DEFAULT
,
sort_params
=
{},
use_fresh_tag
=
False
):
def
filter_article
(
query
,
offset
,
size
,
filters
=
{},
sort_type
=
ARTICLE_SORT_TYPE
.
DEFAULT
,
sort_params
=
{},
use_fresh_tag
=
False
):
articles
=
recall_art
(
query
,
offset
,
size
,
filters
,
use_fresh_tag
)
articles
=
recall_art
(
query
,
offset
,
size
,
filters
,
use_fresh_tag
)
article_list
=
[]
article_list
=
[]
...
...
search/views/board.py
View file @
219c81c2
from
gm_rpcd.all
import
bind
from
gm_rpcd.all
import
bind
from
search.utils.board
import
recall_board
from
search.utils.board
import
recall_board
@bind
(
"d
ori
s/search/board"
)
@bind
(
"d
yma
s/search/board"
)
def
search_board
(
query
,
filters
=
{},
offset
=
0
,
size
=
2
):
def
search_board
(
query
,
filters
=
{},
offset
=
0
,
size
=
2
):
board_ids
=
recall_board
(
query
,
offset
,
size
,
filters
)
board_ids
=
recall_board
(
query
,
offset
,
size
,
filters
)
return
{
"board_ids"
:
board_ids
}
return
{
"board_ids"
:
board_ids
}
...
...
search/views/content_aggre.py
View file @
219c81c2
...
@@ -21,7 +21,7 @@ logger = logging.getLogger(__name__)
...
@@ -21,7 +21,7 @@ logger = logging.getLogger(__name__)
# top_data={CARD_TYPE.DIARY: [], CARD_TYPE.USERTOPIC: [], CARD_TYPE.QA: [], }
# top_data={CARD_TYPE.DIARY: [], CARD_TYPE.USERTOPIC: [], CARD_TYPE.QA: [], }
@bind
(
"d
ori
s/search/content_aggre_communit_sort"
)
@bind
(
"d
yma
s/search/content_aggre_communit_sort"
)
def
content_aggre_communit_sort
(
current_tag
=
[],
size
=
10
,
offset
=
0
,
is_video
=
False
,
sort_type
=
CONTENT_AGGRE_SORT
.
DEFAULT
,
def
content_aggre_communit_sort
(
current_tag
=
[],
size
=
10
,
offset
=
0
,
is_video
=
False
,
sort_type
=
CONTENT_AGGRE_SORT
.
DEFAULT
,
sun_tag
=
[],
parent_tag
=
[],
device_id
=
""
,
user_city_tag_id
=
None
,
in_whitelist
=
False
,
sun_tag
=
[],
parent_tag
=
[],
device_id
=
""
,
user_city_tag_id
=
None
,
in_whitelist
=
False
,
top_data
=
{
CARD_TYPE
.
DIARY
:
[],
CARD_TYPE
.
USERTOPIC
:
[],
CARD_TYPE
.
QA
:
[]}):
top_data
=
{
CARD_TYPE
.
DIARY
:
[],
CARD_TYPE
.
USERTOPIC
:
[],
CARD_TYPE
.
QA
:
[]}):
...
@@ -1308,7 +1308,7 @@ def _get_tractate_ret_list(ret_list, tractate_results_list, tractate_index, scor
...
@@ -1308,7 +1308,7 @@ def _get_tractate_ret_list(ret_list, tractate_results_list, tractate_index, scor
return
(
True
,
tractate_index
)
return
(
True
,
tractate_index
)
@bind
(
"d
ori
s/search/content_aggre_sku_sort"
)
@bind
(
"d
yma
s/search/content_aggre_sku_sort"
)
def
content_aggre_sku_sort
(
current_tag
=
[],
size
=
10
,
offset
=
0
,
sun_tag
=
[],
parent_tag
=
[],
user_city_tag_id
=
None
,
def
content_aggre_sku_sort
(
current_tag
=
[],
size
=
10
,
offset
=
0
,
sun_tag
=
[],
parent_tag
=
[],
user_city_tag_id
=
None
,
in_whitelist
=
False
,
source_from
=
"sku"
):
in_whitelist
=
False
,
source_from
=
"sku"
):
"""
"""
...
@@ -1687,7 +1687,7 @@ def process_sorting(sort_params):
...
@@ -1687,7 +1687,7 @@ def process_sorting(sort_params):
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
@bind
(
"d
ori
s/search/category_aggre_sort"
)
@bind
(
"d
yma
s/search/category_aggre_sort"
)
def
category_aggre_sort
(
current_tag
=
[],
size
=
10
,
offset
=
0
,
device_id
=
""
,
user_city_tag_id
=
None
,
in_whitelist
=
False
,
def
category_aggre_sort
(
current_tag
=
[],
size
=
10
,
offset
=
0
,
device_id
=
""
,
user_city_tag_id
=
None
,
in_whitelist
=
False
,
is_video
=
False
,
need_cpc_data
=
False
):
is_video
=
False
,
need_cpc_data
=
False
):
"""
"""
...
@@ -2125,7 +2125,7 @@ def get_answer_data_category(all_new_tag=[], have_read_dict=[], offset=0, size=1
...
@@ -2125,7 +2125,7 @@ def get_answer_data_category(all_new_tag=[], have_read_dict=[], offset=0, size=1
# ai扫脸或测肤报告页最美购或日记分类展示,下面参数tag_list是列表嵌套列表
# ai扫脸或测肤报告页最美购或日记分类展示,下面参数tag_list是列表嵌套列表
@bind
(
"d
ori
s/search/ai_content"
)
@bind
(
"d
yma
s/search/ai_content"
)
def
ai_content
(
has_order
,
tag_list
,
in_whitelist
,
user_city_tag_id
,
device_id
):
def
ai_content
(
has_order
,
tag_list
,
in_whitelist
,
user_city_tag_id
,
device_id
):
if
has_order
:
if
has_order
:
data
=
ai_service
(
tag_list
,
in_whitelist
,
user_city_tag_id
,
device_id
)
data
=
ai_service
(
tag_list
,
in_whitelist
,
user_city_tag_id
,
device_id
)
...
@@ -2272,7 +2272,7 @@ def ai_diary(tag_list, in_whitelist, user_city_tag_id, device_id):
...
@@ -2272,7 +2272,7 @@ def ai_diary(tag_list, in_whitelist, user_city_tag_id, device_id):
# ai测肤报告页最上面美购或日记展示。下面参数tag_list是列表嵌套列表
# ai测肤报告页最上面美购或日记展示。下面参数tag_list是列表嵌套列表
@bind
(
"d
ori
s/search/skin_ai_total_content"
)
@bind
(
"d
yma
s/search/skin_ai_total_content"
)
def
skin_ai_total_content
(
has_order
,
tag_list
,
in_whitelist
,
user_city_tag_id
,
device_id
):
def
skin_ai_total_content
(
has_order
,
tag_list
,
in_whitelist
,
user_city_tag_id
,
device_id
):
if
has_order
:
if
has_order
:
data
=
skin_service
(
tag_list
,
in_whitelist
,
user_city_tag_id
,
device_id
)
data
=
skin_service
(
tag_list
,
in_whitelist
,
user_city_tag_id
,
device_id
)
...
...
search/views/diary.py
View file @
219c81c2
...
@@ -2110,7 +2110,7 @@ def index_filter_diary(filters, offset=0, size=10):
...
@@ -2110,7 +2110,7 @@ def index_filter_diary(filters, offset=0, size=10):
# todo
# todo
# 取美购列表中美购关联的日记本
# 取美购列表中美购关联的日记本
# 排序按照首页精选排序
# 排序按照首页精选排序
@bind
(
'd
ori
s/search/get_diaries_by_special_id'
)
@bind
(
'd
yma
s/search/get_diaries_by_special_id'
)
def
get_diaries_by_special_id
(
special_id
,
offset
=
0
,
size
=
10
):
def
get_diaries_by_special_id
(
special_id
,
offset
=
0
,
size
=
10
):
filters
=
{
"special_id"
:
special_id
}
filters
=
{
"special_id"
:
special_id
}
hitids
=
index_filter_diary
(
filters
,
offset
,
size
)
hitids
=
index_filter_diary
(
filters
,
offset
,
size
)
...
@@ -2120,14 +2120,14 @@ def get_diaries_by_special_id(special_id, offset=0, size=10):
...
@@ -2120,14 +2120,14 @@ def get_diaries_by_special_id(special_id, offset=0, size=10):
# todo
# todo
# 取美购列表中美购关联的日记本
# 取美购列表中美购关联的日记本
# 排序按照首页精选排序
# 排序按照首页精选排序
@bind
(
'd
ori
s/search/get_index_diaries'
)
@bind
(
'd
yma
s/search/get_index_diaries'
)
def
get_index_diaries
(
offset
=
0
,
size
=
10
):
def
get_index_diaries
(
offset
=
0
,
size
=
10
):
hitids
=
index_filter_diary
({},
offset
,
size
)
hitids
=
index_filter_diary
({},
offset
,
size
)
return
{
'diaries'
:
hitids
}
return
{
'diaries'
:
hitids
}
# 将gaia 请求es日记数据代码合并过来
# 将gaia 请求es日记数据代码合并过来
@bind
(
"d
ori
s/search/query_diary"
)
@bind
(
"d
yma
s/search/query_diary"
)
def
query_diary
(
def
query_diary
(
query
=
''
,
query
=
''
,
offset
=
0
,
offset
=
0
,
...
@@ -2172,7 +2172,7 @@ def query_diary(
...
@@ -2172,7 +2172,7 @@ def query_diary(
return
res
return
res
@bind
(
"d
ori
s/search/query_diary_alpha"
)
@bind
(
"d
yma
s/search/query_diary_alpha"
)
def
query_diary_alpha
(
def
query_diary_alpha
(
query
=
''
,
query
=
''
,
offset
=
0
,
offset
=
0
,
...
@@ -2196,7 +2196,7 @@ def query_diary_alpha(
...
@@ -2196,7 +2196,7 @@ def query_diary_alpha(
# 将gaia 请求es日记数据代码合并过来
# 将gaia 请求es日记数据代码合并过来
@bind
(
"d
ori
s/search/query_filter_diary"
)
@bind
(
"d
yma
s/search/query_filter_diary"
)
def
query_filter_diary
(
def
query_filter_diary
(
offset
=
0
,
offset
=
0
,
size
=
5
,
size
=
5
,
...
@@ -2214,7 +2214,7 @@ def query_filter_diary(
...
@@ -2214,7 +2214,7 @@ def query_filter_diary(
filter_invalid_picture
,
fields
,
use_fresh_tag
,
device_id
,
source_type
)
filter_invalid_picture
,
fields
,
use_fresh_tag
,
device_id
,
source_type
)
@bind
(
"d
ori
s/search/diaries"
)
@bind
(
"d
yma
s/search/diaries"
)
def
get_diaries
(
query
=
''
,
offset
=
0
,
size
=
10
,
user_city_tag_id
=
None
,
sort_type
=
DIARY_ORDER_TYPE
.
DEFAULT
,
filters
=
{}):
def
get_diaries
(
query
=
''
,
offset
=
0
,
size
=
10
,
user_city_tag_id
=
None
,
sort_type
=
DIARY_ORDER_TYPE
.
DEFAULT
,
filters
=
{}):
sort_params
=
{}
sort_params
=
{}
if
user_city_tag_id
:
if
user_city_tag_id
:
...
...
search/views/doctor.py
View file @
219c81c2
...
@@ -404,7 +404,7 @@ def filter_doctor(offset=0, size=5, sort_type=DOCTOR_ORDER_TYPE.DEFAULT2, filter
...
@@ -404,7 +404,7 @@ def filter_doctor(offset=0, size=5, sort_type=DOCTOR_ORDER_TYPE.DEFAULT2, filter
#todo
#todo
#取美购列表中美购关联的医生
#取美购列表中美购关联的医生
#排序按照找医生默认排序输出
#排序按照找医生默认排序输出
@bind
(
'd
ori
s/search/get_doctors_by_special_id'
)
@bind
(
'd
yma
s/search/get_doctors_by_special_id'
)
def
get_doctors_by_special_id
(
special_id
,
offset
=
0
,
size
=
10
,
sort_type
=
DOCTOR_ORDER_TYPE
.
DEFAULT
):
def
get_doctors_by_special_id
(
special_id
,
offset
=
0
,
size
=
10
,
sort_type
=
DOCTOR_ORDER_TYPE
.
DEFAULT
):
nested_fields
=
{
"special_id"
:
special_id
}
nested_fields
=
{
"special_id"
:
special_id
}
es_data
=
filter_doctor
(
es_data
=
filter_doctor
(
...
...
search/views/home_feed.py
View file @
219c81c2
...
@@ -77,7 +77,7 @@ def get_device_unread(device_id, tab_type, feed_type, city_id, offset, size,
...
@@ -77,7 +77,7 @@ def get_device_unread(device_id, tab_type, feed_type, city_id, offset, size,
return
ret
if
ret
else
recommends
[:
size
]
return
ret
if
ret
else
recommends
[:
size
]
@bind
(
"d
ori
s/recommend/home_feed"
)
@bind
(
"d
yma
s/recommend/home_feed"
)
def
get_home_feed_recommend
(
device_id
,
tab_type
,
feed_type
,
offset
,
size
,
city_id
,
**
kwargs
):
def
get_home_feed_recommend
(
device_id
,
tab_type
,
feed_type
,
offset
,
size
,
city_id
,
**
kwargs
):
"""获取首页feed推荐的id列表。
"""获取首页feed推荐的id列表。
...
@@ -91,7 +91,7 @@ def get_home_feed_recommend(device_id, tab_type, feed_type, offset, size, city_i
...
@@ -91,7 +91,7 @@ def get_home_feed_recommend(device_id, tab_type, feed_type, offset, size, city_i
return
{
feed_type
:
res
}
return
{
feed_type
:
res
}
@bind
(
"d
ori
s/recommend/video_tab"
)
@bind
(
"d
yma
s/recommend/video_tab"
)
def
get_video_tab_recommend
(
card_type
,
offset
,
size
,
device_id
,
source_type
,
**
kwargs
):
def
get_video_tab_recommend
(
card_type
,
offset
,
size
,
device_id
,
source_type
,
**
kwargs
):
try
:
try
:
logging
.
info
(
"get redis_client:
%
s"
%
redis_client
)
logging
.
info
(
"get redis_client:
%
s"
%
redis_client
)
...
...
search/views/mind.py
View file @
219c81c2
...
@@ -36,7 +36,7 @@ def label_key(label):
...
@@ -36,7 +36,7 @@ def label_key(label):
return
LABEL_VALUE
.
get
(
label
)
return
LABEL_VALUE
.
get
(
label
)
@bind
(
'd
ori
s/query/inference'
)
@bind
(
'd
yma
s/query/inference'
)
def
query_inference
(
query
=
''
):
def
query_inference
(
query
=
''
):
try
:
try
:
labels
=
list
()
labels
=
list
()
...
...
search/views/principal_page.py
View file @
219c81c2
...
@@ -15,7 +15,7 @@ MAX_LOAD = 200
...
@@ -15,7 +15,7 @@ MAX_LOAD = 200
GROUP_SIZE
=
10
GROUP_SIZE
=
10
@bind
(
'd
ori
s/search/query_principal'
)
@bind
(
'd
yma
s/search/query_principal'
)
def
query_principal
(
query
=
''
,
doctor_type
=
0
,
offset
=
0
,
size
=
10
):
def
query_principal
(
query
=
''
,
doctor_type
=
0
,
offset
=
0
,
size
=
10
):
now
=
int
(
time
.
time
())
now
=
int
(
time
.
time
())
...
@@ -61,7 +61,7 @@ def query_principal(query='', doctor_type=0, offset=0, size=10):
...
@@ -61,7 +61,7 @@ def query_principal(query='', doctor_type=0, offset=0, size=10):
return
{
'video_list'
:
[],
"tractate_list"
:
[]}
return
{
'video_list'
:
[],
"tractate_list"
:
[]}
@bind
(
'd
ori
s/search/query_principal_sort'
)
@bind
(
'd
yma
s/search/query_principal_sort'
)
def
query_principal_sort
(
query
=
''
,
doctor_type
=
0
,
offset
=
0
,
size
=
10
):
def
query_principal_sort
(
query
=
''
,
doctor_type
=
0
,
offset
=
0
,
size
=
10
):
"""
"""
医生医院二级页面混排
医生医院二级页面混排
...
@@ -710,7 +710,7 @@ def get_two_page_data(query, doctor_type):
...
@@ -710,7 +710,7 @@ def get_two_page_data(query, doctor_type):
return
[]
return
[]
@bind
(
"d
ori
s/search/user_principal"
)
@bind
(
"d
yma
s/search/user_principal"
)
def
user_principal
(
query
=
0
,
offset
=
0
,
size
=
10
,
show_type
=
[]):
def
user_principal
(
query
=
0
,
offset
=
0
,
size
=
10
,
show_type
=
[]):
try
:
try
:
channel_type
=
0
channel_type
=
0
...
@@ -932,7 +932,7 @@ def user_principal(query=0, offset=0, size=10, show_type=[]):
...
@@ -932,7 +932,7 @@ def user_principal(query=0, offset=0, size=10, show_type=[]):
return
{
'user_principal_sort'
:
[]}
return
{
'user_principal_sort'
:
[]}
@bind
(
"
doris
/search/user_photoalbum_sort"
)
@bind
(
"
v
/search/user_photoalbum_sort"
)
def
get_user_album
(
user_id
=-
1
,
offset
=
0
,
size
=
10
):
def
get_user_album
(
user_id
=-
1
,
offset
=
0
,
size
=
10
):
"""
"""
用户主页下的相册的排序 日记问答帖子的排序
用户主页下的相册的排序 日记问答帖子的排序
...
...
search/views/question.py
View file @
219c81c2
...
@@ -56,7 +56,7 @@ def query_by_question_term(es, term, sort, offset, size):
...
@@ -56,7 +56,7 @@ def query_by_question_term(es, term, sort, offset, size):
return
hit_ids
return
hit_ids
@bind
(
'd
ori
s/filter/question'
)
@bind
(
'd
yma
s/filter/question'
)
def
filter_question
(
tag_id
,
sort_type
,
offset
=
0
,
size
=
10
,
filters
=
{},
use_fresh_tag
=
False
):
def
filter_question
(
tag_id
,
sort_type
,
offset
=
0
,
size
=
10
,
filters
=
{},
use_fresh_tag
=
False
):
# term = {"term": {"closure_tag_ids": tag_id}}
# term = {"term": {"closure_tag_ids": tag_id}}
# es = get_es()
# es = get_es()
...
@@ -82,12 +82,12 @@ def filter_question(tag_id, sort_type, offset=0, size=10, filters={},use_fresh_t
...
@@ -82,12 +82,12 @@ def filter_question(tag_id, sort_type, offset=0, size=10, filters={},use_fresh_t
return
{
"questions"
:
question_ids
}
return
{
"questions"
:
question_ids
}
@bind
(
"d
ori
s/search/recommend_question"
)
@bind
(
"d
yma
s/search/recommend_question"
)
def
recommend_question
(
query
=
""
,
offset
=
0
,
size
=
10
,
filters
=
{},
sort_type
=
QUESTION_ORDER_TYPE
.
DEFAULT
):
def
recommend_question
(
query
=
""
,
offset
=
0
,
size
=
10
,
filters
=
{},
sort_type
=
QUESTION_ORDER_TYPE
.
DEFAULT
):
res
=
recall_recommend_question_and_sku
(
query
,
offset
,
size
,
filters
,
sort_type
)
res
=
recall_recommend_question_and_sku
(
query
,
offset
,
size
,
filters
,
sort_type
)
return
{
"result"
:
res
}
return
{
"result"
:
res
}
@bind
(
"d
ori
s/search/question"
)
@bind
(
"d
yma
s/search/question"
)
def
search_question
(
query
=
""
,
offset
=
0
,
size
=
10
,
filters
=
{},
sort_type
=
QUESTION_ORDER_TYPE
.
DEFAULT
,
drop_duplicated
=
True
,
need_diary_data
=
False
):
def
search_question
(
query
=
""
,
offset
=
0
,
size
=
10
,
filters
=
{},
sort_type
=
QUESTION_ORDER_TYPE
.
DEFAULT
,
drop_duplicated
=
True
,
need_diary_data
=
False
):
tail
=
offset
+
size
tail
=
offset
+
size
question_ids
=
[]
question_ids
=
[]
...
@@ -130,7 +130,7 @@ def search_question(query="", offset=0, size=10, filters={}, sort_type=QUESTION_
...
@@ -130,7 +130,7 @@ def search_question(query="", offset=0, size=10, filters={}, sort_type=QUESTION_
return
{
"question_problem_ids"
:
question_ids
}
return
{
"question_problem_ids"
:
question_ids
}
@bind
(
'd
ori
s/filter/top_question'
)
@bind
(
'd
yma
s/filter/top_question'
)
def
filter_top_question
(
sort_type
=
TOP_QUESTION_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
offset
=
0
,
size
=
10
):
def
filter_top_question
(
sort_type
=
TOP_QUESTION_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
offset
=
0
,
size
=
10
):
"""
"""
召回置顶问题
召回置顶问题
...
...
search/views/relation_search.py
View file @
219c81c2
...
@@ -59,7 +59,7 @@ class Tag(models.Model):
...
@@ -59,7 +59,7 @@ class Tag(models.Model):
tag_type
=
models
.
CharField
(
verbose_name
=
u'标签类型'
,
max_length
=
128
)
tag_type
=
models
.
CharField
(
verbose_name
=
u'标签类型'
,
max_length
=
128
)
@bind
(
'd
ori
s/search/get_relation_query'
)
@bind
(
'd
yma
s/search/get_relation_query'
)
def
get_relation_query
(
query
=
""
,
size
=
6
,
offset
=
0
,
device_id
=
""
):
def
get_relation_query
(
query
=
""
,
size
=
6
,
offset
=
0
,
device_id
=
""
):
"""
"""
搜索相关
搜索相关
...
@@ -120,7 +120,7 @@ def get_relation_query(query="", size=6, offset=0, device_id=""):
...
@@ -120,7 +120,7 @@ def get_relation_query(query="", size=6, offset=0, device_id=""):
return
{
"relation_search_word"
:
[]}
return
{
"relation_search_word"
:
[]}
@bind
(
'd
ori
s/search/get_default_word'
)
@bind
(
'd
yma
s/search/get_default_word'
)
def
get_default_word
(
device_id
=
""
):
def
get_default_word
(
device_id
=
""
):
"""
"""
个性化展示数据限制为9个,热门词4-5个,运营配置词1-2个,总数保证为15个
个性化展示数据限制为9个,热门词4-5个,运营配置词1-2个,总数保证为15个
...
@@ -166,7 +166,7 @@ def get_default_word(device_id=""):
...
@@ -166,7 +166,7 @@ def get_default_word(device_id=""):
#
#
@bind
(
'd
ori
s/search/feed_other_watch'
)
@bind
(
'd
yma
s/search/feed_other_watch'
)
def
feed_other_watch
(
device_id
=
""
,
tag_ids
=
[],
size
=
4
):
def
feed_other_watch
(
device_id
=
""
,
tag_ids
=
[],
size
=
4
):
"""
"""
个性化展示数据限制为9个,热门词4-5个,运营配置词1-2个,总数保证为15个
个性化展示数据限制为9个,热门词4-5个,运营配置词1-2个,总数保证为15个
...
...
search/views/search_comprehensive.py
View file @
219c81c2
...
@@ -230,7 +230,7 @@ def _get_article_ret_list(ret_list, article_results_list, article_index, score_b
...
@@ -230,7 +230,7 @@ def _get_article_ret_list(ret_list, article_results_list, article_index, score_b
return
(
True
,
article_index
)
return
(
True
,
article_index
)
@bind
(
"d
ori
s/search/query_comprehensive"
)
@bind
(
"d
yma
s/search/query_comprehensive"
)
def
query_comprehensive
(
query
=
''
,
def
query_comprehensive
(
query
=
''
,
offset
=
0
,
offset
=
0
,
size
=
10
,
size
=
10
,
...
...
search/views/service.py
View file @
219c81c2
...
@@ -12,7 +12,7 @@ import logging
...
@@ -12,7 +12,7 @@ import logging
import
time
import
time
@bind
(
'd
ori
s/search/guess_you_like_service'
)
@bind
(
'd
yma
s/search/guess_you_like_service'
)
def
guess_you_like_service
(
hospital_id
=
None
,
tag_id
=
None
,
user_city_info
=
None
,
def
guess_you_like_service
(
hospital_id
=
None
,
tag_id
=
None
,
user_city_info
=
None
,
doctor_id
=
None
,
offset
=
0
,
size
=
10
):
doctor_id
=
None
,
offset
=
0
,
size
=
10
):
"""
"""
...
...
search/views/sku.py
View file @
219c81c2
...
@@ -303,7 +303,7 @@ def query_sku(query='', user_city_tag_id=None, offset=0, size=2,
...
@@ -303,7 +303,7 @@ def query_sku(query='', user_city_tag_id=None, offset=0, size=2,
# @param sort_params 排序条件
# @param sort_params 排序条件
# @date 20180409
# @date 20180409
@bind
(
'd
ori
s/search/as_query_sku'
)
@bind
(
'd
yma
s/search/as_query_sku'
)
def
as_query_sku
(
query
=
''
,
user_city_tag_id
=
None
,
offset
=
0
,
size
=
10
,
def
as_query_sku
(
query
=
''
,
user_city_tag_id
=
None
,
offset
=
0
,
size
=
10
,
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
sort_params
=
{},
or_filters
=
[],
must_filters
=
False
,
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
sort_params
=
{},
or_filters
=
[],
must_filters
=
False
,
inner_hits
=
False
,
have_get_service_ids
=
[]):
inner_hits
=
False
,
have_get_service_ids
=
[]):
...
@@ -393,7 +393,7 @@ def as_query_sku(query='', user_city_tag_id=None, offset=0, size=10,
...
@@ -393,7 +393,7 @@ def as_query_sku(query='', user_city_tag_id=None, offset=0, size=10,
return
{
"sku_ids"
:
[],
"rank_mode"
:
RANK_MODE
.
DEFAULT
,
"is_cpc"
:
[]}
return
{
"sku_ids"
:
[],
"rank_mode"
:
RANK_MODE
.
DEFAULT
,
"is_cpc"
:
[]}
@bind
(
'd
ori
s/search/as_query_sku_pure'
)
@bind
(
'd
yma
s/search/as_query_sku_pure'
)
def
as_query_sku_pure
(
query
=
''
,
user_city_tag_id
=
None
,
offset
=
0
,
size
=
10
,
def
as_query_sku_pure
(
query
=
''
,
user_city_tag_id
=
None
,
offset
=
0
,
size
=
10
,
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
sort_params
=
{},
or_filters
=
[]):
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
sort_params
=
{},
or_filters
=
[]):
"""基于sku mapping的es高级搜索"""
"""基于sku mapping的es高级搜索"""
...
@@ -784,7 +784,7 @@ def get_mix_floor_hits(offset=0, size=10, special_id=None, sort_type=SERVICE_ORD
...
@@ -784,7 +784,7 @@ def get_mix_floor_hits(offset=0, size=10, special_id=None, sort_type=SERVICE_ORD
return
{},
RANK_MODE
.
DEFAULT
return
{},
RANK_MODE
.
DEFAULT
@bind
(
'd
ori
s/search/seckill'
)
@bind
(
'd
yma
s/search/seckill'
)
def
seckill_query
(
special_id
,
user_city_info
=
None
,
offset
=
0
,
size
=
10
,
def
seckill_query
(
special_id
,
user_city_info
=
None
,
offset
=
0
,
size
=
10
,
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
sort_params
=
{},
or_filters
=
[]):
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
sort_params
=
{},
or_filters
=
[]):
"""秒杀美购列表
"""秒杀美购列表
...
@@ -839,7 +839,7 @@ def seckill_query(special_id, user_city_info=None, offset=0, size=10,
...
@@ -839,7 +839,7 @@ def seckill_query(special_id, user_city_info=None, offset=0, size=10,
return
{
'skus'
:
skus_info
,
'rank_mode'
:
rest_result
[
'rank_mode'
]}
return
{
'skus'
:
skus_info
,
'rank_mode'
:
rest_result
[
'rank_mode'
]}
@bind
(
'd
ori
s/search/special'
)
@bind
(
'd
yma
s/search/special'
)
def
special_query
(
special_id
,
user_city_info
=
None
,
floor_id
=
None
,
def
special_query
(
special_id
,
user_city_info
=
None
,
floor_id
=
None
,
offset
=
0
,
size
=
10
,
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
offset
=
0
,
size
=
10
,
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
sort_params
=
{},
or_filters
=
[],
mix_floor
=
False
):
filters
=
{},
sort_params
=
{},
or_filters
=
[],
mix_floor
=
False
):
...
@@ -923,7 +923,7 @@ def special_query(special_id, user_city_info=None, floor_id=None,
...
@@ -923,7 +923,7 @@ def special_query(special_id, user_city_info=None, floor_id=None,
return
{
'skus'
:
skus_info
,
'rank_mode'
:
result
[
'rank_mode'
]}
return
{
'skus'
:
skus_info
,
'rank_mode'
:
result
[
'rank_mode'
]}
@bind
(
'd
ori
s/search/judge_service_cpc'
)
@bind
(
'd
yma
s/search/judge_service_cpc'
)
def
judge_service_cpc
(
service_ids
=
[]):
def
judge_service_cpc
(
service_ids
=
[]):
"""
"""
统计接口判断美购是否是cpc
统计接口判断美购是否是cpc
...
@@ -968,7 +968,7 @@ def judge_service_cpc(service_ids=[]):
...
@@ -968,7 +968,7 @@ def judge_service_cpc(service_ids=[]):
return
[]
return
[]
@bind
(
'd
ori
s/search/service_home_recommend'
)
@bind
(
'd
yma
s/search/service_home_recommend'
)
def
recommend_service_feed
(
device_id
=
""
,
offset
=
0
,
size
=
10
,
def
recommend_service_feed
(
device_id
=
""
,
offset
=
0
,
size
=
10
,
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
filters
=
None
,
sort_params
=
None
,
filters
=
None
,
sort_params
=
None
,
...
@@ -1158,7 +1158,7 @@ def recommend_service_feed(device_id="", offset=0, size=10,
...
@@ -1158,7 +1158,7 @@ def recommend_service_feed(device_id="", offset=0, size=10,
return
{
"user_portrait_data"
:
{},
"normal_sort_data"
:
{}}
return
{
"user_portrait_data"
:
{},
"normal_sort_data"
:
{}}
@bind
(
'd
ori
s/search/content_detail_service'
)
@bind
(
'd
yma
s/search/content_detail_service'
)
def
content_detail_service
(
card_id
=-
1
,
card_type
=
None
,
card_author_message
=
{},
user_city_tag_id
=-
1
,
tags
=
{},
size
=
3
,
def
content_detail_service
(
card_id
=-
1
,
card_type
=
None
,
card_author_message
=
{},
user_city_tag_id
=-
1
,
tags
=
{},
size
=
3
,
related_serviceid
=
[]):
related_serviceid
=
[]):
"""
"""
...
...
search/views/spu.py
View file @
219c81c2
...
@@ -6,7 +6,7 @@ from recommend.utils.device import get_realtime_interest
...
@@ -6,7 +6,7 @@ from recommend.utils.device import get_realtime_interest
from
search.utils.service
import
recall_spu
,
SMARTRANK_SORT
from
search.utils.service
import
recall_spu
,
SMARTRANK_SORT
@bind
(
'd
ori
s/search/query_spu'
)
@bind
(
'd
yma
s/search/query_spu'
)
def
query_spu
(
query
=
''
,
user_city_tag_id
=
None
,
offset
=
0
,
size
=
10
,
def
query_spu
(
query
=
''
,
user_city_tag_id
=
None
,
offset
=
0
,
size
=
10
,
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
sort_params
=
{},
or_filters
=
[]):
sort_type
=
SERVICE_ORDER_TYPE
.
DEFAULT
,
filters
=
{},
sort_params
=
{},
or_filters
=
[]):
if
sort_type
==
SERVICE_ORDER_TYPE
.
DEFAULT_REALTIME
and
(
'device_id'
in
sort_params
):
if
sort_type
==
SERVICE_ORDER_TYPE
.
DEFAULT_REALTIME
and
(
'device_id'
in
sort_params
):
...
...
search/views/subscript_article.py
View file @
219c81c2
...
@@ -14,7 +14,7 @@ from libs.algorithms import variousness,variousness_for_problem
...
@@ -14,7 +14,7 @@ from libs.algorithms import variousness,variousness_for_problem
from
search.utils.subscript_article
import
recall_subscript_article
from
search.utils.subscript_article
import
recall_subscript_article
@bind
(
'd
ori
s/filter/subscript_article'
)
@bind
(
'd
yma
s/filter/subscript_article'
)
def
filter_subscript_article
(
query
,
sort_type
=
SUBSCRIPT_ARTICLE_SORT
.
ORDERING
,
offset
=
0
,
count
=
10
,
filters
=
{}):
def
filter_subscript_article
(
query
,
sort_type
=
SUBSCRIPT_ARTICLE_SORT
.
ORDERING
,
offset
=
0
,
count
=
10
,
filters
=
{}):
"""搜索公众号文章。
"""搜索公众号文章。
...
...
search/views/tractate.py
View file @
219c81c2
...
@@ -257,7 +257,7 @@ def query_filter_comprehensive_tractate(query=None, have_read_tractate_list=[],
...
@@ -257,7 +257,7 @@ def query_filter_comprehensive_tractate(query=None, have_read_tractate_list=[],
return
dict
()
return
dict
()
@bind
(
'd
ori
s/search/query_filter_tractate'
)
@bind
(
'd
yma
s/search/query_filter_tractate'
)
def
query_filter_tractate
(
query
=
None
,
offset
=
0
,
size
=
10
,
have_read_tractate_list
=
[],
use_fresh_tag
=
False
,
def
query_filter_tractate
(
query
=
None
,
offset
=
0
,
size
=
10
,
have_read_tractate_list
=
[],
use_fresh_tag
=
False
,
device_id
=
""
):
device_id
=
""
):
try
:
try
:
...
@@ -411,7 +411,7 @@ def scatter(data, size):
...
@@ -411,7 +411,7 @@ def scatter(data, size):
return
data
[:
size
]
return
data
[:
size
]
@bind
(
'd
ori
s/search/tractate_sort'
)
@bind
(
'd
yma
s/search/tractate_sort'
)
def
tractate_sort
(
filters
=
None
,
offset
=
0
,
size
=
10
,
query
=
None
,
use_fresh_tag
=
False
,
device_id
=
''
,
source_type
=
0
,
def
tractate_sort
(
filters
=
None
,
offset
=
0
,
size
=
10
,
query
=
None
,
use_fresh_tag
=
False
,
device_id
=
''
,
source_type
=
0
,
get_query
=
False
,
have_read_tractate
=
[],
noarea_tags
=
[],
all_tags
=
[],
content_star_keyword
=
[]):
get_query
=
False
,
have_read_tractate
=
[],
noarea_tags
=
[],
all_tags
=
[],
content_star_keyword
=
[]):
try
:
try
:
...
@@ -639,7 +639,7 @@ def tractate_sort(filters=None, offset=0, size=10, query=None, use_fresh_tag=Fal
...
@@ -639,7 +639,7 @@ def tractate_sort(filters=None, offset=0, size=10, query=None, use_fresh_tag=Fal
return
{
'tractate_id_list'
:
[]}
return
{
'tractate_id_list'
:
[]}
@bind
(
'd
ori
s/search/doctor_tractate_sort'
)
@bind
(
'd
yma
s/search/doctor_tractate_sort'
)
def
doctor_tractate_sort
(
filters
=
None
,
offset
=
0
,
size
=
10
,
query
=
None
):
def
doctor_tractate_sort
(
filters
=
None
,
offset
=
0
,
size
=
10
,
query
=
None
):
try
:
try
:
filters
=
filters
or
{}
filters
=
filters
or
{}
...
@@ -686,7 +686,7 @@ def doctor_tractate_sort(filters=None, offset=0, size=10, query=None):
...
@@ -686,7 +686,7 @@ def doctor_tractate_sort(filters=None, offset=0, size=10, query=None):
return
{
'tractate_id_list'
:
[]}
return
{
'tractate_id_list'
:
[]}
@bind
(
'd
ori
s/search/tractate_hotword'
)
@bind
(
'd
yma
s/search/tractate_hotword'
)
def
tractate_hotword
(
query
=
''
,
size
=
10
):
def
tractate_hotword
(
query
=
''
,
size
=
10
):
try
:
try
:
redis_key
=
"gaia:hot_tractate_keyword:city_id:"
+
str
(
query
)
redis_key
=
"gaia:hot_tractate_keyword:city_id:"
+
str
(
query
)
...
@@ -702,7 +702,7 @@ def tractate_hotword(query='', size=10):
...
@@ -702,7 +702,7 @@ def tractate_hotword(query='', size=10):
return
{
"hot_recommends"
:
[]}
return
{
"hot_recommends"
:
[]}
@bind
(
'd
ori
s/search/tractate_check_in'
)
@bind
(
'd
yma
s/search/tractate_check_in'
)
def
tractate_check_in
(
device_id
,
size
):
def
tractate_check_in
(
device_id
,
size
):
try
:
try
:
key
=
'device_register_tractate_queue:'
+
str
(
device_id
)
key
=
'device_register_tractate_queue:'
+
str
(
device_id
)
...
...
search/views/wiki.py
View file @
219c81c2
...
@@ -14,7 +14,7 @@ GROUP_SIZE = 10
...
@@ -14,7 +14,7 @@ GROUP_SIZE = 10
variousness_per_10
=
functools
.
partial
(
variousness
,
variety_size
=
GROUP_SIZE
)
variousness_per_10
=
functools
.
partial
(
variousness
,
variety_size
=
GROUP_SIZE
)
@bind
(
'd
ori
s/search/query_wiki'
)
@bind
(
'd
yma
s/search/query_wiki'
)
def
query_wiki
(
query
=
''
,
offset
=
0
,
size
=
10
):
def
query_wiki
(
query
=
''
,
offset
=
0
,
size
=
10
):
try
:
try
:
...
@@ -142,7 +142,7 @@ def query_wiki(query='', offset=0, size=10):
...
@@ -142,7 +142,7 @@ def query_wiki(query='', offset=0, size=10):
return
{
'wiki_all'
:
[]}
return
{
'wiki_all'
:
[]}
@bind
(
'd
ori
s/search/wiki_sort'
)
@bind
(
'd
yma
s/search/wiki_sort'
)
def
wiki_sort
(
filters
=
None
,
offset
=
0
,
size
=
10
):
def
wiki_sort
(
filters
=
None
,
offset
=
0
,
size
=
10
):
try
:
try
:
filters
=
filters
or
{}
filters
=
filters
or
{}
...
...
search/views/wiki_keyword.py
View file @
219c81c2
...
@@ -18,7 +18,7 @@ GROUP_SIZE = 10
...
@@ -18,7 +18,7 @@ GROUP_SIZE = 10
variousness_per_10
=
functools
.
partial
(
variousness
,
variety_size
=
GROUP_SIZE
)
variousness_per_10
=
functools
.
partial
(
variousness
,
variety_size
=
GROUP_SIZE
)
@bind
(
'd
ori
s/search/query_wikitab_keyword'
)
@bind
(
'd
yma
s/search/query_wikitab_keyword'
)
def
query_wiki_keyword
(
query
,
offset
=
0
,
size
=
10
,
flag
=
False
):
def
query_wiki_keyword
(
query
,
offset
=
0
,
size
=
10
,
flag
=
False
):
try
:
try
:
wiki_hot_keyword
=
HotKeyWord
.
fetch_keyword
(
query
)
wiki_hot_keyword
=
HotKeyWord
.
fetch_keyword
(
query
)
...
...
search/views/wikitab.py
View file @
219c81c2
...
@@ -22,7 +22,7 @@ GROUP_SIZE = 10
...
@@ -22,7 +22,7 @@ GROUP_SIZE = 10
variousness_per_10
=
functools
.
partial
(
variousness
,
variety_size
=
GROUP_SIZE
)
variousness_per_10
=
functools
.
partial
(
variousness
,
variety_size
=
GROUP_SIZE
)
@bind
(
'd
ori
s/search/query_wikitab'
)
@bind
(
'd
yma
s/search/query_wikitab'
)
def
query_wiki
(
query
=
''
,
offset
=
0
,
size
=
10
,
city_id
=
''
,
source_type
=
"tab"
,
device_id
=
""
):
def
query_wiki
(
query
=
''
,
offset
=
0
,
size
=
10
,
city_id
=
''
,
source_type
=
"tab"
,
device_id
=
""
):
size
=
min
(
size
,
MAX_LOAD
)
size
=
min
(
size
,
MAX_LOAD
)
...
@@ -655,7 +655,7 @@ def get_zonghe_query(query, synonym_term_list):
...
@@ -655,7 +655,7 @@ def get_zonghe_query(query, synonym_term_list):
return
[]
return
[]
@bind
(
'd
ori
s/search/query_wiki_card'
)
@bind
(
'd
yma
s/search/query_wiki_card'
)
def
get_collect_wiki_card
(
query
=
""
):
def
get_collect_wiki_card
(
query
=
""
):
try
:
try
:
all_data
=
{}
all_data
=
{}
...
...
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