Skip to content

Unindexed full-text search is case-sensitive #747

Closed

Description

@ragnorc

Behaviour

search($d.title, $q) on a String property with no @index runs the substrate's flat scan with the bare tokenizer: "deep" matches only "deep dive", "Deep" only "Deep Learning". The same two titles under an indexed type match both rows for both spellings. Measured on a production graph as match_text($o.name, "Anthropic") returning 2 rows and "anthropic" returning 0, with no signal.

Mechanism

full_text_search on a column with no FTS segments plans a flat scan with default_text_tokenizer() (no lowercasing). TableStore::has_fts_index_on is the per-column detector.

Contract

RFC 0047 (#791, rollout step 3): a full-text function on a property the schema does not declare @index is a compile-time T27 refusal; a declared index that has not been built is refused at planning with FullTextIndexRequired (the RFC 0043 FullTextIndexRebuildRequired shape), read from a planning fact recorded in the plan's Assumptions. Engine v1 refuses the unbuilt case at its query door. The analyzed lexical search RFC (#792) later replaces the refusal with an exact scan under the field's analyzer. Invariant 7: index presence must not change the answer. Reproduced on engine v2 on 2026-09-28.

Regression case

unindexed_search_is_case_sensitive.gqt on the evidence branch. The fix lands it as issue_N_unindexed_search_is_case_sensitive.gqt with the corpus's --- runner header; steps 3–4 become T27 refusals, steps 1–2 stay as controls.

Activity

  1. self-assigned this
    on Oct 1, 2026
  2. azimafroozeh commented on Oct 1, 2026

    @azimafroozeh
    Collaborator
    # issue: 747
    # notes: `search` on a String property with no `@index` must be refused (T27), since the unindexed scan is case-sensitive and an indexed property is not.
    # red_on: 2026-10-01, main 97f293e8: the query succeeds and returns a1 only.
    
    --- runner
    timeout_ms: 10000
    environments:
      - target: omnigraph-engine
        storage: local-filesystem
    
    --- schema
    node Doc {
        slug: String @key
        title: String
    }
    
    --- seed
    {"type":"Doc","data":{"slug":"a1","title":"deep dive"}}
    {"type":"Doc","data":{"slug":"a2","title":"Deep Learning"}}
    
    --- query
    query lowercase() { match { $d: Doc search($d.title, "deep") } return { $d.slug } }
    --- expect error: T27
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