Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
searchhotcrawler
Overview
Overview
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
zhiwei
searchhotcrawler
Commits
26b458d8
Commit
26b458d8
authored
May 27, 2021
by
chenweitao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'working' into 'master'
评论量讨论量数据类型超限 See merge request
!80
parents
b9b6305c
00b41a46
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
+9
-9
No files found.
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
View file @
26b458d8
...
...
@@ -77,8 +77,8 @@ public class HotSearchCacheDAO {
try
{
String
name
=
document
.
getString
(
"name"
);
String
type
=
document
.
getString
(
"type"
);
Integer
lastRank
=
document
.
getInteger
(
"rank"
)!=
null
?
document
.
getInteger
(
"rank"
):
null
;
Integer
lastCount
=
document
.
getInteger
(
"count"
)!=
null
?
document
.
getInteger
(
"count"
):
null
;
Long
lastRank
=
document
.
getLong
(
"rank"
)!=
null
?
document
.
getLong
(
"rank"
):
null
;
Long
lastCount
=
document
.
getLong
(
"count"
)!=
null
?
document
.
getLong
(
"count"
):
null
;
Date
startTime
=
document
.
getDate
(
"time"
);
Date
endTime
=
getEndTime
(
type
,
startTime
);
String
topicLead
=
document
.
getString
(
"topic_lead"
)!=
null
?
document
.
getString
(
"topic_lead"
):
null
;
...
...
@@ -101,10 +101,10 @@ public class HotSearchCacheDAO {
if
(
Objects
.
nonNull
(
lastRank
)
&&
lastRank
>
0
){
Document
nowDoc
=
(
Document
)
collection
.
find
(
query
).
first
();
if
(
Objects
.
nonNull
(
nowDoc
))
{
Integer
highestRank
=
nowDoc
.
getInteger
(
"highestRank"
);
Integer
highestCount
=
nowDoc
.
getInteger
(
"highestCount"
);
Long
highestRank
=
nowDoc
.
getLong
(
"highestRank"
);
Long
highestCount
=
nowDoc
.
getLong
(
"highestCount"
);
Integer
preRank
=
nowDoc
.
getInteger
(
"lastRank"
);
Integer
preCount
=
nowDoc
.
getInteger
(
"lastCount"
);
Long
preCount
=
nowDoc
.
getLong
(
"lastCount"
);
String
lastUrl
=
nowDoc
.
getString
(
"url"
);
//判断最大热度值
if
(
Objects
.
nonNull
(
lastCount
)
&&
Objects
.
nonNull
(
highestCount
)
&&
lastCount
>
highestCount
)
{
...
...
@@ -123,7 +123,7 @@ public class HotSearchCacheDAO {
//计算上升速度
double
riseSpeed
=
nowDoc
.
containsKey
(
"riseSpeed"
)?
nowDoc
.
getDouble
(
"riseSpeed"
):
0.00
;
if
(
Objects
.
nonNull
(
lastCount
)
&&
nowDoc
.
containsKey
(
"firstCount"
))
{
int
firstCount
=
nowDoc
.
getInteger
(
"firstCount"
);
long
firstCount
=
nowDoc
.
getLong
(
"firstCount"
);
riseSpeed
=
((
double
)(
lastCount
-
firstCount
)/(
double
)
firstCount
)*
1000
/((
double
)
duration
);
}
// endTime = getEndTime(type, new Date());
...
...
@@ -191,8 +191,8 @@ public class HotSearchCacheDAO {
nowDoc
.
put
(
"topicLead"
,
nowDoc
.
getString
(
"topicLead"
));
}
if
(
nowDoc
.
containsKey
(
"readCount"
)
&&
nowDoc
.
containsKey
(
"discussCount"
))
{
nowDoc
.
put
(
"readCount"
,
nowDoc
.
get
Integer
(
"readCount"
));
nowDoc
.
put
(
"discussCount"
,
nowDoc
.
get
Integer
(
"discussCount"
));
nowDoc
.
put
(
"readCount"
,
nowDoc
.
get
Long
(
"readCount"
));
nowDoc
.
put
(
"discussCount"
,
nowDoc
.
get
Long
(
"discussCount"
));
}
if
(
nowDoc
.
containsKey
(
"pictureUrl"
))
{
nowDoc
.
put
(
"pictureUrl"
,
nowDoc
.
getString
(
"pictureUrl"
));
...
...
@@ -205,7 +205,7 @@ public class HotSearchCacheDAO {
}
}
}
catch
(
Exception
e
){
log
.
info
(
"数据存储时出错:{}"
,
e
);
log
.
error
(
"数据存储时出错:{}"
,
e
);
}
}
...
...
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