@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.

    • 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.

    • 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.

    • Apply generic full-text document semantics to in-memory persistence.

      Parameters

      • document: Record<string, unknown>
      • primaryField: string
      • indexField: string
      • indexFieldQualified: string = indexField
      • OptionalpreviousDocument: Record<string, unknown>

      Returns Promise<void>