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
059ad63f
Commit
059ad63f
authored
Jun 17, 2020
by
zhiwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复搜狗热搜因没有热度值导致的相应更新错误
parent
33f69a5d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
+8
-8
No files found.
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
View file @
059ad63f
...
...
@@ -59,8 +59,8 @@ public class HotSearchCacheDAO {
try
{
String
name
=
document
.
getString
(
"name"
);
String
type
=
document
.
getString
(
"type"
);
int
lastRank
=
document
.
getInteger
(
"rank"
)!=
null
?
document
.
getInteger
(
"rank"
):
-
1
;
int
lastCount
=
document
.
getInteger
(
"count"
)!=
null
?
document
.
getInteger
(
"count"
):
-
1
;
Integer
lastRank
=
document
.
getInteger
(
"rank"
)!=
null
?
document
.
getInteger
(
"rank"
):
null
;
Integer
lastCount
=
document
.
getInteger
(
"count"
)!=
null
?
document
.
getInteger
(
"count"
):
null
;
Date
startTime
=
document
.
getDate
(
"time"
);
Date
endTime
=
getEndTime
(
type
,
startTime
);
String
topicLead
=
document
.
getString
(
"topic_lead"
)!=
null
?
document
.
getString
(
"topic_lead"
):
null
;
...
...
@@ -70,17 +70,17 @@ public class HotSearchCacheDAO {
Document
query
=
new
Document
(
"_id"
,
id
);
Document
nowDoc
=
(
Document
)
collection
.
find
(
query
).
first
();
if
(
Objects
.
nonNull
(
nowDoc
))
{
int
highestRank
=
nowDoc
.
getInteger
(
"highestRank"
);
int
highestCount
=
nowDoc
.
getInteger
(
"highestCount"
);
int
preRank
=
nowDoc
.
getInteger
(
"lastRank"
);
int
preCount
=
nowDoc
.
getInteger
(
"lastCount"
);
Integer
highestRank
=
nowDoc
.
getInteger
(
"highestRank"
);
Integer
highestCount
=
nowDoc
.
getInteger
(
"highestCount"
);
Integer
preRank
=
nowDoc
.
getInteger
(
"lastRank"
);
Integer
preCount
=
nowDoc
.
getInteger
(
"lastCount"
);
//判断最大热度值
if
(
lastCount
>
highestCount
)
{
if
(
Objects
.
nonNull
(
lastCount
)
&&
Objects
.
nonNull
(
highestCount
)
&&
lastCount
>
highestCount
)
{
highestCount
=
lastCount
;
}
//判断最高排名
if
(
highestRank
<
0
){
if
(
Objects
.
nonNull
(
lastRank
)
&&
highestRank
<
0
){
highestRank
=
lastRank
;
}
if
(
lastRank
>
0
&&
highestRank
>
0
&&
lastRank
<
highestRank
)
{
...
...
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