2023-02-14 21:23:46 +01:00
|
|
|
// this is not part of the Docusaurus site, but a copy of the active config in the Algolia Crawler
|
|
|
|
new Crawler({
|
2024-01-12 06:11:41 +01:00
|
|
|
appId: "CO73R59OLO",
|
|
|
|
apiKey: "ALGOLIA_CRAWLER_API_KEY",
|
2023-02-14 21:23:46 +01:00
|
|
|
rateLimit: 8,
|
|
|
|
maxDepth: 10,
|
2024-01-12 06:11:41 +01:00
|
|
|
startUrls: ["https://docs.zrok.io/"],
|
|
|
|
sitemaps: ["https://docs.zrok.io/sitemap.xml"],
|
|
|
|
ignoreCanonicalTo: false,
|
|
|
|
discoveryPatterns: ["https://docs.zrok.io/**"],
|
|
|
|
schedule: "every 1 day at 2:22 pm",
|
2023-02-14 21:23:46 +01:00
|
|
|
actions: [
|
|
|
|
{
|
2024-01-12 06:11:41 +01:00
|
|
|
indexName: "zrok",
|
|
|
|
pathsToMatch: ["https://docs.zrok.io/**"],
|
2023-02-14 21:23:46 +01:00
|
|
|
recordExtractor: ({ $, helpers }) => {
|
|
|
|
// priority order: deepest active sub list header -> navbar active item -> 'Documentation'
|
|
|
|
const lvl0 =
|
|
|
|
$(
|
2024-01-12 06:11:41 +01:00
|
|
|
".menu__link.menu__link--sublist.menu__link--active, .navbar__item.navbar__link--active",
|
2023-02-14 21:23:46 +01:00
|
|
|
)
|
|
|
|
.last()
|
2024-01-12 06:11:41 +01:00
|
|
|
.text() || "Documentation";
|
2023-02-14 21:23:46 +01:00
|
|
|
|
|
|
|
return helpers.docsearch({
|
|
|
|
recordProps: {
|
|
|
|
lvl0: {
|
2024-01-12 06:11:41 +01:00
|
|
|
selectors: "",
|
2023-02-14 21:23:46 +01:00
|
|
|
defaultValue: lvl0,
|
|
|
|
},
|
2024-01-12 06:11:41 +01:00
|
|
|
lvl1: ["header h1", "article h1"],
|
|
|
|
lvl2: "article h2",
|
|
|
|
lvl3: "article h3",
|
|
|
|
lvl4: "article h4",
|
|
|
|
lvl5: "article h5, article td:first-child",
|
|
|
|
lvl6: "article h6",
|
|
|
|
content: "article p, article li, article td:last-child",
|
2023-02-14 21:23:46 +01:00
|
|
|
},
|
|
|
|
indexHeadings: true,
|
|
|
|
aggregateContent: true,
|
2024-01-12 06:11:41 +01:00
|
|
|
recordVersion: "v3",
|
2023-02-14 21:23:46 +01:00
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
initialIndexSettings: {
|
|
|
|
zrok: {
|
|
|
|
attributesForFaceting: [
|
2024-01-12 06:11:41 +01:00
|
|
|
"type",
|
|
|
|
"lang",
|
|
|
|
"language",
|
|
|
|
"version",
|
|
|
|
"docusaurus_tag",
|
2023-02-14 21:23:46 +01:00
|
|
|
],
|
|
|
|
attributesToRetrieve: [
|
2024-01-12 06:11:41 +01:00
|
|
|
"hierarchy",
|
|
|
|
"content",
|
|
|
|
"anchor",
|
|
|
|
"url",
|
|
|
|
"url_without_anchor",
|
|
|
|
"type",
|
2023-02-14 21:23:46 +01:00
|
|
|
],
|
2024-01-12 06:11:41 +01:00
|
|
|
attributesToHighlight: ["hierarchy", "content"],
|
|
|
|
attributesToSnippet: ["content:10"],
|
|
|
|
camelCaseAttributes: ["hierarchy", "content"],
|
2023-02-14 21:23:46 +01:00
|
|
|
searchableAttributes: [
|
2024-01-12 06:11:41 +01:00
|
|
|
"unordered(hierarchy.lvl0)",
|
|
|
|
"unordered(hierarchy.lvl1)",
|
|
|
|
"unordered(hierarchy.lvl2)",
|
|
|
|
"unordered(hierarchy.lvl3)",
|
|
|
|
"unordered(hierarchy.lvl4)",
|
|
|
|
"unordered(hierarchy.lvl5)",
|
|
|
|
"unordered(hierarchy.lvl6)",
|
|
|
|
"content",
|
2023-02-14 21:23:46 +01:00
|
|
|
],
|
|
|
|
distinct: true,
|
2024-01-12 06:11:41 +01:00
|
|
|
attributeForDistinct: "url",
|
2023-02-14 21:23:46 +01:00
|
|
|
customRanking: [
|
2024-01-12 06:11:41 +01:00
|
|
|
"desc(weight.pageRank)",
|
|
|
|
"desc(weight.level)",
|
|
|
|
"asc(weight.position)",
|
2023-02-14 21:23:46 +01:00
|
|
|
],
|
|
|
|
ranking: [
|
2024-01-12 06:11:41 +01:00
|
|
|
"words",
|
|
|
|
"filters",
|
|
|
|
"typo",
|
|
|
|
"attribute",
|
|
|
|
"proximity",
|
|
|
|
"exact",
|
|
|
|
"custom",
|
2023-02-14 21:23:46 +01:00
|
|
|
],
|
|
|
|
highlightPreTag: '<span class="algolia-docsearch-suggestion--highlight">',
|
2024-01-12 06:11:41 +01:00
|
|
|
highlightPostTag: "</span>",
|
2023-02-14 21:23:46 +01:00
|
|
|
minWordSizefor1Typo: 3,
|
|
|
|
minWordSizefor2Typos: 7,
|
|
|
|
allowTyposOnNumericTokens: false,
|
|
|
|
minProximity: 1,
|
|
|
|
ignorePlurals: true,
|
|
|
|
advancedSyntax: true,
|
|
|
|
attributeCriteriaComputedByMinProximity: true,
|
2024-01-12 06:11:41 +01:00
|
|
|
removeWordsIfNoResults: "allOptional",
|
|
|
|
separatorsToIndex: "_",
|
2023-02-14 21:23:46 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|