|
Author |
hbghlyj
Posted at 2025-3-31 23:35:54
为何作者名都连在一起
以下是crawler配置,应该修改第26行,如何修改?- new Crawler({
- appId: "KZZUGXICHQ",
- apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
- maxUrls: null,
- indexPrefix: "",
- rateLimit: 8,
- renderJavaScript: false,
- ignoreQueryParams: ["extra", "mobile"],
- startUrls: [
- "https://kuing.cjhb.site/forum.php?mod=forumdisplay&fid=5",
- "https://kuing.cjhb.site/forum.php?mod=forumdisplay&fid=6",
- "https://kuing.cjhb.site/forum.php?mod=forumdisplay&fid=14",
- ],
- discoveryPatterns: ["https://kuing.cjhb.site/**"],
- schedule: "every 1 day at 12:51 pm",
- maxDepth: 10,
- actions: [
- {
- indexName: "kuing",
- pathsToMatch: ["https://kuing.cjhb.site/thread*"],
- recordExtractor: ({ url, $, contentLength, fileType }) => {
- return [
- {
- objectID: url,
- title: $("title").text().split(" - ").slice(0, -3).join(" - "),
- author: $(".authi a").text(),
- forum: $("title").text().split(" - ").slice(-3, -2)[0],
- keywords: $('meta[name="keywords"]').prop("content"),
- description: $('meta[name="description"]').prop("content"),
- totalposts: $("div.message").length,
- content: $("div.message")
- .map(function () {
- $(this).find("i.pstatus").remove();
- return $(this).text();
- })
- .get()
- .join("\n"),
- },
- ];
- },
- },
- ],
- sitemaps: ["https://kuing.cjhb.site/sitemap.xml"],
- initialIndexSettings: {
- kuing: {
- advancedSyntax: true,
- allowTyposOnNumericTokens: false,
- attributeCriteriaComputedByMinProximity: true,
- attributeForDistinct: "url",
- attributesToRetrieve: ["*"],
- attributesToSnippet: ["content:10"],
- attributesForFaceting: ["forum"],
- customRanking: [
- "desc(weight.pageRank)",
- "desc(weight.level)",
- "asc(weight.position)",
- ],
- distinct: 1,
- highlightPostTag: "</span>",
- highlightPreTag: '<span class="algolia-docsearch-suggestion--highlight">',
- ignorePlurals: true,
- minProximity: 1,
- minWordSizefor1Typo: 3,
- minWordSizefor2Typos: 7,
- ranking: [
- "words",
- "filters",
- "typo",
- "attribute",
- "proximity",
- "exact",
- "custom",
- ],
- removeWordsIfNoResults: "allOptional",
- searchableAttributes: [
- "unordered(title)",
- "author",
- "unordered(keywords)",
- "unordered(description)",
- "unordered(content)",
- ],
- },
- },
- ignoreCanonicalTo: false,
- safetyChecks: { beforeIndexPublishing: { maxLostRecordsPercentage: 10 } },
- saveBackup: true,
- });
Copy the Code |
|