Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
谢明辉
/
VVAS-Match
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f79c2950
authored
Sep 09, 2024
by
姚冰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[chg] 得分计算优化,减少部分日志内容
1 parent
5f7f1352
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
src/main/java/com/viontech/match/service/PersonService.java
src/main/java/com/viontech/match/service/PoolService.java
src/main/java/com/viontech/match/service/PersonService.java
View file @
f79c295
...
@@ -180,7 +180,7 @@ public class PersonService {
...
@@ -180,7 +180,7 @@ public class PersonService {
}
}
success
.
setMatch
(
1
);
success
.
setMatch
(
1
);
success
.
setPersonPoolStatus
(
poolStatus
);
success
.
setPersonPoolStatus
(
poolStatus
);
log
.
info
(
"人员匹配
操作完成,PoolIds:{}, poolStatus:{},rid:{},耗时
:{}"
,
poolIds
,
JSON
.
toJSONString
(
poolStatus
),
rid
,
System
.
currentTimeMillis
()
-
startTime
);
log
.
info
(
"人员匹配
,Pool:{}, status:{},rid:{},time
:{}"
,
poolIds
,
JSON
.
toJSONString
(
poolStatus
),
rid
,
System
.
currentTimeMillis
()
-
startTime
);
return
success
;
return
success
;
}
catch
(
ElasticsearchException
e
)
{
}
catch
(
ElasticsearchException
e
)
{
if
(
e
.
status
()
==
400
&&
e
.
getMessage
().
contains
(
Constant
.
CLASS_CAST_EXCEPTION
))
{
if
(
e
.
status
()
==
400
&&
e
.
getMessage
().
contains
(
Constant
.
CLASS_CAST_EXCEPTION
))
{
...
@@ -424,7 +424,7 @@ public class PersonService {
...
@@ -424,7 +424,7 @@ public class PersonService {
.
query
(
getSearchSourceBuilder
(
feature
,
person
,
type
).
_toQuery
())
.
query
(
getSearchSourceBuilder
(
feature
,
person
,
type
).
_toQuery
())
.
script
(
new
Script
.
Builder
()
.
script
(
new
Script
.
Builder
()
.
lang
(
"painless"
)
.
lang
(
"painless"
)
.
source
(
"
(_score + 1)/2
* 100"
)
.
source
(
"
_score
* 100"
)
.
params
(
"body"
,
JsonData
.
of
(
0.0f
))
.
params
(
"body"
,
JsonData
.
of
(
0.0f
))
.
build
())
.
build
())
.
boost
(
1.0f
)
.
boost
(
1.0f
)
...
...
src/main/java/com/viontech/match/service/PoolService.java
View file @
f79c295
...
@@ -79,7 +79,7 @@ public class PoolService {
...
@@ -79,7 +79,7 @@ public class PoolService {
public
ResponseVo
createPool
(
RequestVo
requestVo
,
boolean
addPerson
)
throws
Exception
{
public
ResponseVo
createPool
(
RequestVo
requestVo
,
boolean
addPerson
)
throws
Exception
{
String
rid
=
requestVo
.
getRid
();
String
rid
=
requestVo
.
getRid
();
String
poolId
=
requestVo
.
getPoolId
();
String
poolId
=
requestVo
.
getPoolId
();
log
.
info
(
"特征池创建操作开始:[{}},IML:{}"
,
poolId
,
requestVo
.
isUseILMPolicy
());
//
log.info("特征池创建操作开始:[{}},IML:{}", poolId, requestVo.isUseILMPolicy());
try
{
try
{
IndexSettings
.
Builder
settings
=
new
IndexSettings
.
Builder
()
IndexSettings
.
Builder
settings
=
new
IndexSettings
.
Builder
()
...
@@ -117,7 +117,7 @@ public class PoolService {
...
@@ -117,7 +117,7 @@ public class PoolService {
}
}
}
}
log
.
info
(
"特征池创建
操作
完成:[{}],ILM:{}"
,
poolId
,
requestVo
.
isUseILMPolicy
());
log
.
info
(
"特征池创建完成:[{}],ILM:{}"
,
poolId
,
requestVo
.
isUseILMPolicy
());
return
ResponseVo
.
success
(
rid
);
return
ResponseVo
.
success
(
rid
);
}
catch
(
ElasticsearchException
e
)
{
}
catch
(
ElasticsearchException
e
)
{
if
(
e
.
status
()
==
400
&&
e
.
getMessage
().
contains
(
Constant
.
STR_POOL_ID_ALREADY_EXISTS
))
{
if
(
e
.
status
()
==
400
&&
e
.
getMessage
().
contains
(
Constant
.
STR_POOL_ID_ALREADY_EXISTS
))
{
...
@@ -141,7 +141,7 @@ public class PoolService {
...
@@ -141,7 +141,7 @@ public class PoolService {
String
rid
=
requestVo
.
getRid
();
String
rid
=
requestVo
.
getRid
();
Integer
flushPool
=
requestVo
.
getFlushPool
();
Integer
flushPool
=
requestVo
.
getFlushPool
();
String
poolId
=
requestVo
.
getPoolId
();
String
poolId
=
requestVo
.
getPoolId
();
log
.
info
(
"特征池删除操作开始:[{}],FlushPool:[{}]"
,
poolId
,
flushPool
);
//
log.info("特征池删除操作开始:[{}],FlushPool:[{}]", poolId, flushPool);
try
{
try
{
if
(
0
==
flushPool
)
{
if
(
0
==
flushPool
)
{
List
<
HashMap
<
String
,
String
>>
personIds
=
requestVo
.
getPersonIds
();
List
<
HashMap
<
String
,
String
>>
personIds
=
requestVo
.
getPersonIds
();
...
@@ -155,7 +155,7 @@ public class PoolService {
...
@@ -155,7 +155,7 @@ public class PoolService {
//删除索引
//删除索引
DeleteIndexResponse
delete
=
client
.
indices
().
delete
(
new
DeleteIndexRequest
.
Builder
().
index
(
poolId
).
build
());
DeleteIndexResponse
delete
=
client
.
indices
().
delete
(
new
DeleteIndexRequest
.
Builder
().
index
(
poolId
).
build
());
}
}
log
.
info
(
"特征池删除
操作
完成:[{}],FlushPool:[{}]"
,
poolId
,
flushPool
);
log
.
info
(
"特征池删除完成:[{}],FlushPool:[{}]"
,
poolId
,
flushPool
);
return
ResponseVo
.
success
(
rid
);
return
ResponseVo
.
success
(
rid
);
}
catch
(
ElasticsearchException
e
)
{
}
catch
(
ElasticsearchException
e
)
{
if
(
e
.
status
()
==
404
)
{
if
(
e
.
status
()
==
404
)
{
...
@@ -192,7 +192,7 @@ public class PoolService {
...
@@ -192,7 +192,7 @@ public class PoolService {
return
ResponseVo
.
error
(
rid
,
bulkItemResponses
.
items
().
toString
());
return
ResponseVo
.
error
(
rid
,
bulkItemResponses
.
items
().
toString
());
}
}
log
.
info
(
"特征池修改
操作完成
:[{}],updateType:[{}]"
,
poolId
,
updateType
);
log
.
info
(
"特征池修改:[{}],updateType:[{}]"
,
poolId
,
updateType
);
return
ResponseVo
.
success
(
rid
,
"success"
);
return
ResponseVo
.
success
(
rid
,
"success"
);
}
catch
(
ElasticsearchException
e
)
{
}
catch
(
ElasticsearchException
e
)
{
log
.
error
(
"modifyPool"
,
e
);
log
.
error
(
"modifyPool"
,
e
);
...
@@ -214,7 +214,7 @@ public class PoolService {
...
@@ -214,7 +214,7 @@ public class PoolService {
String
poolId
=
requestVo
.
getPoolId
();
String
poolId
=
requestVo
.
getPoolId
();
try
{
try
{
List
<
PoolInfo
>
poolInfos
;
List
<
PoolInfo
>
poolInfos
;
log
.
info
(
"查询特征池操作开始:[{}],rid:[{}]"
,
poolId
,
rid
);
//
log.info("查询特征池操作开始:[{}],rid:[{}]", poolId, rid);
if
(
listAll
!=
0
)
{
if
(
listAll
!=
0
)
{
poolInfos
=
queryPoolInfo
(
poolId
);
poolInfos
=
queryPoolInfo
(
poolId
);
...
@@ -226,7 +226,7 @@ public class PoolService {
...
@@ -226,7 +226,7 @@ public class PoolService {
}
}
ResponseVo
success
=
ResponseVo
.
success
(
rid
,
"success"
);
ResponseVo
success
=
ResponseVo
.
success
(
rid
,
"success"
);
success
.
setPoolIds
(
poolInfos
);
success
.
setPoolIds
(
poolInfos
);
log
.
info
(
"查询特征池
操作
完成:[{}],rid:[{}]"
,
poolId
,
rid
);
log
.
info
(
"查询特征池完成:[{}],rid:[{}]"
,
poolId
,
rid
);
return
success
;
return
success
;
}
catch
(
ElasticsearchException
e
)
{
}
catch
(
ElasticsearchException
e
)
{
...
@@ -238,7 +238,7 @@ public class PoolService {
...
@@ -238,7 +238,7 @@ public class PoolService {
public
void
refreshPool
(
String
...
poolIds
)
throws
IOException
{
public
void
refreshPool
(
String
...
poolIds
)
throws
IOException
{
RefreshRequest
refreshRequest
=
new
RefreshRequest
.
Builder
().
index
(
Arrays
.
asList
(
poolIds
)).
build
();
RefreshRequest
refreshRequest
=
new
RefreshRequest
.
Builder
().
index
(
Arrays
.
asList
(
poolIds
)).
build
();
RefreshResponse
refresh
=
client
.
indices
().
refresh
(
refreshRequest
);
RefreshResponse
refresh
=
client
.
indices
().
refresh
(
refreshRequest
);
log
.
info
(
"刷新索引:{},成功:{},失败:{}"
,
poolIds
,
refresh
.
shards
().
successful
(),
refresh
.
shards
().
failed
());
//
log.info("刷新索引:{},成功:{},失败:{}", poolIds, refresh.shards().successful(), refresh.shards().failed());
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment