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
9d5e990b
authored
Nov 10, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
0bec2ea8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
service/query/alike_query.go
service/query/alike_query.go
View file @
9d5e990b
...
@@ -14,13 +14,17 @@ import (
...
@@ -14,13 +14,17 @@ import (
func
GetDemeQuery
(
ctx
*
gin
.
Context
)
(
param
string
,
err
error
){
func
GetDemeQuery
(
ctx
*
gin
.
Context
)
(
param
string
,
err
error
){
query
:=
elastic
.
NewBoolQuery
()
query
:=
elastic
.
NewBoolQuery
()
goods_name
:=
ctx
.
Request
.
FormValue
(
"alike_goods_en/eq"
)
goods_name
:=
ctx
.
Request
.
FormValue
(
"alike_goods_en/eq"
)
//国外型号
if
goods_name
!=
""
{
//型号搜索
if
goods_name
!=
""
{
//型号搜索
replace
,
_
:=
regexp
.
Compile
(
"[^A-Za-z0-9]+"
)
replace
,
_
:=
regexp
.
Compile
(
"[^A-Za-z0-9]+"
)
goods_name
=
replace
.
ReplaceAllString
(
goods_name
,
""
)
goods_name
=
replace
.
ReplaceAllString
(
goods_name
,
""
)
goods_name
=
strings
.
ToUpper
(
goods_name
)
goods_name
=
strings
.
ToUpper
(
goods_name
)
query
.
Must
(
elastic
.
NewTermQuery
(
"alike_goods_en.raw"
,
goods_name
))
query
.
Must
(
elastic
.
NewTermQuery
(
"alike_goods_en.raw"
,
goods_name
))
}
}
alike_spu_id
:=
ctx
.
Request
.
FormValue
(
"alike_spu_id/eq"
)
//国外型号spu_id
if
alike_spu_id
!=
""
{
query
.
Must
(
elastic
.
NewTermQuery
(
"alike_spu_id"
,
alike_spu_id
))
}
page
:=
ctx
.
Request
.
FormValue
(
"page"
)
page
:=
ctx
.
Request
.
FormValue
(
"page"
)
page_size
:=
ctx
.
Request
.
FormValue
(
"page_size"
)
page_size
:=
ctx
.
Request
.
FormValue
(
"page_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