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
fa3b5b7e
Commit
fa3b5b7e
authored
Jun 17, 2020
by
zhiwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理微博推荐位的微博热搜,因为无排名所以不纳入总的排名缓存数据表
parent
de934c9d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
+7
-0
No files found.
src/main/java/com/zhiwei/searchhotcrawler/dao/HotSearchCacheDAO.java
View file @
fa3b5b7e
...
@@ -68,6 +68,9 @@ public class HotSearchCacheDAO {
...
@@ -68,6 +68,9 @@ public class HotSearchCacheDAO {
String
url
=
document
.
getString
(
"url"
)!=
null
?
document
.
getString
(
"url"
):
null
;
String
url
=
document
.
getString
(
"url"
)!=
null
?
document
.
getString
(
"url"
):
null
;
String
id
=
name
+
"_"
+
type
;
String
id
=
name
+
"_"
+
type
;
Document
query
=
new
Document
(
"_id"
,
id
);
Document
query
=
new
Document
(
"_id"
,
id
);
//判断是否为微博推荐位,推荐位微博无排名,所以不纳入总的缓存表
if
(
Objects
.
nonNull
(
lastRank
)
&&
lastRank
>
0
){
Document
nowDoc
=
(
Document
)
collection
.
find
(
query
).
first
();
Document
nowDoc
=
(
Document
)
collection
.
find
(
query
).
first
();
if
(
Objects
.
nonNull
(
nowDoc
))
{
if
(
Objects
.
nonNull
(
nowDoc
))
{
Integer
highestRank
=
nowDoc
.
getInteger
(
"highestRank"
);
Integer
highestRank
=
nowDoc
.
getInteger
(
"highestRank"
);
...
@@ -121,6 +124,10 @@ public class HotSearchCacheDAO {
...
@@ -121,6 +124,10 @@ public class HotSearchCacheDAO {
collection
.
insertOne
(
nowDoc
);
collection
.
insertOne
(
nowDoc
);
}
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
info
(
"数据存储时出错:{}"
,
e
);
log
.
info
(
"数据存储时出错:{}"
,
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