Toggle navigation
Toggle navigation
This project
Loading...
Sign in
yoho-search
/
yoho-search-service
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hugufei
9 years ago
Commit
b18a7b64c58df4a6e4d5e1aa6e16bdaf8af24e47
1 parent
12abfe07
商品详情页添加年龄层Id的返回
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
service/src/main/java/com/yoho/search/service/SearchServiceHelper.java
service/src/main/java/com/yoho/search/service/SearchServiceHelper.java
View file @
b18a7b6
...
...
@@ -357,19 +357,19 @@ public class SearchServiceHelper {
String
sknString
=
paramMap
.
get
(
ISearchConstans
.
PARAM_SYNC_SKN
);
boolFilter
.
must
(
FilterBuilders
.
termsFilter
(
"productSkn"
,
sknString
.
split
(
","
)));
}
// 年龄层
if
(
paramMap
.
containsKey
(
ISearchConstans
.
PARAM_SEARCH_AGELEVEL
)
&&
StringUtils
.
isNotBlank
(
paramMap
.
get
(
ISearchConstans
.
PARAM_SEARCH_AGELEVEL
))
&&
!
ISearchConstans
.
PARAM_SEARCH_AGELEVEL
.
equals
(
filterParamName
))
{
int
[]
ageLevels
=
ConvertUtils
.
stringToIntArray
(
paramMap
.
get
(
ISearchConstans
.
PARAM_SEARCH_AGELEVEL
),
","
);
boolFilter
.
must
(
FilterBuilders
.
termsFilter
(
"ageLevel"
,
ageLevels
));
}
// 如果contain_global!=Y,则过滤掉全球购的商品[全球购商品融合需求]
if
(!
paramMap
.
containsKey
(
"contain_global"
)
||
!
"Y"
.
equals
(
paramMap
.
get
(
"contain_global"
))
||
!
ISearchConstans
.
TPL_ADAPTOR_VALID
)
{
boolFilter
.
mustNot
(
FilterBuilders
.
termsFilter
(
"isGlobal"
,
"Y"
));
}
// 通用的过滤请求
for
(
String
key
:
paramMap
.
keySet
())
{
if
(
key
.
startsWith
(
"not_"
))
{
...
...
@@ -405,7 +405,7 @@ public class SearchServiceHelper {
}
return
pageList
;
}
@SuppressWarnings
(
"unchecked"
)
public
Map
<
String
,
Object
>
getProductMap
(
Map
<
String
,
Object
>
map
)
{
Map
<
String
,
Object
>
productMap
=
new
HashMap
<
String
,
Object
>();
...
...
@@ -455,6 +455,9 @@ public class SearchServiceHelper {
// 是否是全球购商品
productMap
.
put
(
"is_global"
,
map
.
get
(
"isGlobal"
)
==
null
?
"N"
:
map
.
get
(
"isGlobal"
));
// 年龄层,逗号隔开的字符串
productMap
.
put
(
"age_level"
,
map
.
get
(
"ageLevel"
)
==
null
?
""
:
map
.
get
(
"ageLevel"
));
return
productMap
;
}
...
...
Please
register
or
login
to post a comment