Add page names to search index (#474)

pull/483/head
Valentin Rieß 2023-07-16 22:45:26 +02:00 committed by GitHub
parent d764c564ec
commit 5cd0f09726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -49,7 +49,9 @@ export class SimpleSearchEngine {
const updateIndexMap = new Map<string, string[]>();
const updateReverseIndexMap = new Map<string, string[]>();
const words = this.tokenize(document.text);
const pageContent = this.tokenize(document.text);
const pageName = this.tokenize(document.id);
const words = [...pageContent, ...pageName];
const filteredWords = this.removeStopWords(words);
const stemmedWords = filteredWords.map((word) => this.stem(word));