Skip to content

BM25 prefix matching scans entire inverted index linearly #19

@rohitg00

Description

@rohitg00

Problem

For each query term, the search iterates ALL entries in the inverted index to find prefix matches. With thousands of unique terms, this is O(queryTerms * vocabularySize).

Location

src/state/search-index.ts:78-97

Suggested Fix

Use a trie or sorted array for prefix lookups instead of linear scan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    highHigh priorityperformancePerformance optimization

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions