Skip to content

Commit 36fa0f1

Browse files
chore: prevent OOM with large doc set
1 parent f3a20cf commit 36fa0f1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/search/flexsearch-core.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ function englishStemmer(word: string): string {
5858
*/
5959
export function createSearchIndex(): FlexSearchDocument {
6060
return new FlexSearch.Document<IndexableDocument, string[]>({
61-
// Use 'full' tokenization for substring matching
62-
// This allows "auth" to match "authentication"
63-
tokenize: 'full',
61+
// Use 'forward' tokenization to avoid OOM with large doc sets
62+
// See: https://github.com/scalvert/docusaurus-plugin-mcp-server/issues/11
63+
tokenize: "forward"
6464

6565
// Enable caching for faster repeated queries
6666
cache: 100,

0 commit comments

Comments
 (0)