Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
208f5105
authored
Jan 15, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
更新类似型号搜索
parent
251aa622
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
service/optimum_service.go
service/query/alike_query.go
service/optimum_service.go
View file @
208f5105
...
...
@@ -64,7 +64,7 @@ func (qs *OptimumService) getQueryAttr(ctx *gin.Context) {
"2001€5.5V€0", #属性值id+属性值+是否选中
"2003€5.6V€0"
]
}
}
alike
}
}
...
...
@@ -86,7 +86,7 @@ func (qs *OptimumService) GetOptimumAttr(ctx *gin.Context) (results model.LyResp
return
}
//查询es
esResult
,
err
:=
es
.
CurlE
sPrimary
(
"goods_optimum"
,
queryString
)
esResult
,
err
:=
es
.
CurlE
S
(
"goods_optimum"
,
queryString
)
if
err
!=
nil
{
results
.
ErrorCode
=
1002
;
results
.
ErrorMsg
=
err
.
Error
()
...
...
service/query/alike_query.go
View file @
208f5105
...
...
@@ -17,9 +17,14 @@ func GetDemeQuery(ctx *gin.Context,target string) (param string, err error){
query
.
Must
(
elastic
.
NewTermQuery
(
"supplier_type"
,
1
))
}
goods_name
:=
common
.
DrawLetterNum
(
ctx
.
Request
.
FormValue
(
"
alike_spu
_name/eq"
))
//国外型号
goods_name
:=
common
.
DrawLetterNum
(
ctx
.
Request
.
FormValue
(
"
goods
_name/eq"
))
//国外型号
if
goods_name
!=
""
{
//型号搜索
query
.
Must
(
elastic
.
NewTermQuery
(
"alike_spu_name.raw"
,
goods_name
))
query
.
Must
(
elastic
.
NewTermQuery
(
"auto_goods_name.raw"
,
goods_name
))
}
alike_spu_name
:=
common
.
DrawLetterNum
(
ctx
.
Request
.
FormValue
(
"alike_spu_name/eq"
))
//国外型号
if
alike_spu_name
!=
""
{
//类似型号搜索
query
.
Must
(
elastic
.
NewTermQuery
(
"alike_spu_name.raw"
,
alike_spu_name
))
}
alike_spu_id
:=
ctx
.
Request
.
FormValue
(
"alike_spu_id/eq"
)
//国外型号spu_id
if
alike_spu_id
!=
""
{
...
...
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