@resistdesign/voltra
    Preparing search index...

    Class FullTextMemoryBackend

    In-memory backend combining lossy and exact indexes.

    Implements

    Index

    Methods

    • Add exact token positions for a document.

      Parameters

      • token: string

        Token value to store positions for.

      • indexField: string

        Field name the token was indexed under.

      • docId: DocId

        Document id containing the token.

      • positions: number[]

        Token positions within the document.

      Returns Promise<void>

      Promise resolved once positions are stored.

    • Add a lossy posting for a token.

      Parameters

      • token: string

        Token value to add.

      • indexField: string

        Field name the token was indexed under.

      • docId: DocId

        Document id containing the token.

      Returns Promise<void>

      Promise resolved once posting is added.

    • Check whether a document contains a token.

      Parameters

      • docId: DocId

        Document id to check.

      • indexField: string

        Field name the token was indexed under.

      • token: string

        Token value to check.

      Returns Promise<boolean>

      True when the document contains the token.

    • Load exact positions for a token in a document.

      Parameters

      • token: string

        Token value to load positions for.

      • indexField: string

        Field name the token was indexed under.

      • docId: DocId

        Document id containing the token.

      Returns Promise<number[] | undefined>

      Positions array or undefined when missing.

    • Load lossy postings for a token.

      Parameters

      • token: string

        Token value to load postings for.

      • indexField: string

        Field name the token was indexed under.

      Returns Promise<DocId[]>

      Document ids containing the token.

    • Load token stats for a token.

      Parameters

      • token: string

        Token value to load stats for.

      • indexField: string

        Field name the token was indexed under.

      Returns Promise<TokenStats | undefined>

      Token stats or undefined when no postings exist.

    • Remove exact token positions for a document.

      Parameters

      • token: string

        Token value to remove positions for.

      • indexField: string

        Field name the token was indexed under.

      • docId: DocId

        Document id containing the token.

      Returns Promise<void>

      Promise resolved once positions are removed.

    • Remove a lossy posting for a token.

      Parameters

      • token: string

        Token value to remove.

      • indexField: string

        Field name the token was indexed under.

      • docId: DocId

        Document id containing the token.

      Returns Promise<void>

      Promise resolved once posting is removed.