Fix redirect importing
This commit is contained in:
parent
e91a2db1b1
commit
2e6539cbc5
1 changed files with 10 additions and 2 deletions
|
|
@ -79,12 +79,20 @@ fn first_stage() -> io::Result<(AdjacencyList<PageInfo, LinkInfo>, Titles)> {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
for (to, start, end) in json_page.links {
|
if let Some(to) = json_page.redirect {
|
||||||
let to = titles.insert(util::normalize_link(&to));
|
let to = titles.insert(util::normalize_link(&to));
|
||||||
result.links.push(Link {
|
result.links.push(Link {
|
||||||
to,
|
to,
|
||||||
data: LinkInfo { start, end },
|
data: LinkInfo { start: 0, end: 0 },
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
for (to, start, end) in json_page.links {
|
||||||
|
let to = titles.insert(util::normalize_link(&to));
|
||||||
|
result.links.push(Link {
|
||||||
|
to,
|
||||||
|
data: LinkInfo { start, end },
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i + 1) % 100_000 == 0 {
|
if (i + 1) % 100_000 == 0 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue