Skip to content

Index state changes which rows a text query matches #749

Open

Description

@ragnorc

Behaviour

Two rows indexed, two identical-shaped rows appended after the build into an uncovered fragment. search finds both beta rows (the uncovered fragment is searched with the index analyzer), but fuzzy at one edit finds running only in the appended row (bare token) and misses the indexed stem run, and finds beto only in the indexed row (no expansion over the uncovered fragment).

Contract

Analyzed lexical search RFC (#792, rollout step 2): one matched set per query across index states, matches(indexed) = matches(unindexed) = matches(partially indexed); the exact scan is the baseline and a native index accelerates only after it proves the same membership.

Regression case

index_state_changes_text_matches.gqt on the evidence branch (steps 3–4 red, including the two mutation steps). The fix lands it as issue_N_index_state_changes_text_matches.gqt with the --- runner header.

Activity

  1. azimafroozeh commented on Oct 1, 2026

    @azimafroozeh
    Collaborator
    # issue: 749
    # notes: A text query must match the same rows whether the index covers a row (seeded a1) or not (b1, inserted after the build). Both hold the same body, so each step expects both.
    # red_on: 2026-10-01, main 97f293e8: `fuzzy "running"` returns b1 only; `fuzzy "beto"` returns a1 only.
    
    --- runner
    timeout_ms: 10000
    environments:
      - target: omnigraph-engine
        storage: local-filesystem
    
    --- schema
    node Doc {
        slug: String @key
        body: String @index
    }
    
    --- seed
    {"type":"Doc","data":{"slug":"a1","body":"running beta"}}
    
    --- mutate
    query add() { insert Doc { slug: "b1", body: "running beta" } }
    --- expect affected: nodes=1 edges=0
    
    --- query
    query fuzzy_running() { match { $d: Doc fuzzy($d.body, "running", 1) } return { $d.slug } }
    --- expect unordered
    {"d.slug":"a1"}
    {"d.slug":"b1"}
    --- expect shape
    d.slug: String
    
    --- query
    query fuzzy_beto() { match { $d: Doc fuzzy($d.body, "beto", 1) } return { $d.slug } }
    --- expect unordered
    {"d.slug":"a1"}
    {"d.slug":"b1"}
    --- expect shape
    d.slug: String
  2. self-assigned this
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P-highHigh priorityacceptedTriaged and validated; open for a PRbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions