Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
streamingUserPortrait
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
赵威
streamingUserPortrait
Commits
589759b8
Commit
589759b8
authored
Feb 07, 2021
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add logger
parent
0ac13815
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
5 deletions
+2
-5
Content.scala
src/main/scala/com.gmei.up/utils/Content.scala
+1
-1
ES.scala
src/main/scala/com.gmei.up/utils/ES.scala
+1
-4
No files found.
src/main/scala/com.gmei.up/utils/Content.scala
View file @
589759b8
package
com.gmei.up.utils
case
class
Content
(
id
:
Long
,
index
:
String
,
serviceId
:
Some
[
Long
],
projects
:
String
)
case
class
Content
(
id
:
Long
,
index
:
String
,
serviceId
:
Option
[
Long
],
projects
:
String
)
src/main/scala/com.gmei.up/utils/ES.scala
View file @
589759b8
...
...
@@ -58,7 +58,7 @@ object ES {
override
def
read
(
hit
:
Hit
)
:
Try
[
Content
]
=
{
val
source
=
hit
.
sourceAsMap
println
(
source
)
val
serviceId
=
source
.
get
(
"service.id"
).
asInstanceOf
[
Some
[
Long
]]
val
serviceId
=
source
.
get
OrElse
(
"service"
,
Map
[
String
,
Long
]()).
asInstanceOf
[
Map
[
String
,
Long
]].
get
(
"id"
)
Try
(
Content
(
source
(
"id"
).
toString
.
toLong
,
hit
.
index
,
serviceId
,
source
(
"tags_v3"
).
toString
)
)
...
...
@@ -69,9 +69,6 @@ object ES {
def
request
(
req
:
SearchRequest
)
:
Either
[
Throwable
,
Future
[
IndexedSeq
[
Content
]]]
=
{
val
client
:
ElasticClient
=
ESClient
.
create
(
"172.16.52.33"
,
9200
,
"elastic"
,
"gengmei!@#"
)
println
(
"!!!!!!!!!!!!!!"
)
println
(
req
.
show
)
println
(
"!!!!!!!!!!!!!!"
)
println
(
"@@@@@@@@@@@@@"
)
client
.
execute
(
req
).
map
{
resp
=>
val
a
=
resp
.
result
.
to
[
Content
]
...
...
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