Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions website/scripts/typesense-index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import chalk from "chalk";
import cheerio from "cheerio";
import {Element} from "domhandler";
import { Element } from "domhandler";
import dotEnv from "dotenv-defaults";
import fs from "fs";
import glob from "glob-promise";
Expand Down Expand Up @@ -261,12 +261,30 @@ async function buildIndex() {
path: `${publicPath}/guides/developer/**/**.html`,
displayPath: "guides/developer",
ranking: 40,
}
},
{
name: "Vector highlights",
path: `${publicPath}/highlights/**/**.html`,
displayPath: "highlights/",
ranking: 40,
},
{
name: "Upgrade guides",
path: `${publicPath}/highlights/*-upgrade-guide/**.html`,
displayPath: "highlights/",
ranking: 10,
},
];

// Recurse through each section and push the resulting records to `allRecords`
for (const section of sections) {
let files = await glob(section.path);

// We shouldn't index upgrade guides
if (section.name === "Vector highlights") {
files = files.filter((path) => !path.includes("-upgrade-guide"))
}

console.log(chalk.blue(`Indexing ${section.displayPath}...`));
await indexHTMLFiles(allRecords, section.name, files, section.ranking);
}
Expand Down
Loading