Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
bom_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
e6bfc3e1
authored
Jul 09, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加分片优先级
parent
0ada3b17
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
internal/logic/attr.go
internal/logic/attr.go
View file @
e6bfc3e1
...
@@ -98,6 +98,7 @@ func searchAttr(bomItem model.BomItem, search *es.MultiSearchService) (result *e
...
@@ -98,6 +98,7 @@ func searchAttr(bomItem model.BomItem, search *es.MultiSearchService) (result *e
attrsSlice
=
append
(
attrsSlice
,
attr
)
attrsSlice
=
append
(
attrsSlice
,
attr
)
}
}
}
}
//fmt.Println(attrsSlice)
query
:=
getQuery
(
attrsSlice
)
query
:=
getQuery
(
attrsSlice
)
//单独针对封装进行转换
//单独针对封装进行转换
if
bomItem
.
Encap
!=
""
{
if
bomItem
.
Encap
!=
""
{
...
@@ -136,7 +137,8 @@ func searchAttr(bomItem model.BomItem, search *es.MultiSearchService) (result *e
...
@@ -136,7 +137,8 @@ func searchAttr(bomItem model.BomItem, search *es.MultiSearchService) (result *e
source
.
Sort
(
"_score"
,
false
)
source
.
Sort
(
"_score"
,
false
)
source
.
Sort
(
"brand_sort"
,
true
)
source
.
Sort
(
"brand_sort"
,
true
)
source
=
source
.
From
(
0
)
.
Size
(
1
)
source
=
source
.
From
(
0
)
.
Size
(
1
)
searchRequest
:=
es
.
NewSearchRequest
()
.
Source
(
source
)
searchRequest
:=
es
.
NewSearchRequest
()
.
Source
(
source
)
.
Preference
(
"_primary"
)
//fmt.Println(searchRequest.Body())
return
search
.
Add
(
searchRequest
)
return
search
.
Add
(
searchRequest
)
}
}
...
...
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