You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cypher CREATE INDEX should implicitly create the referenced property (Neo4j-style lazy schema) #4354
To create an index on a vertex property via Cypher, the user must run three statements in order:
Create the vertex type.
Create the property (with explicit type).
Create the index.
Skipping step 2 (or running the statements out of order) currently fails with a 500 error / cryptic message. Neo4j allows the simpler workflow:
CREATEINDEXFOR (n:Worker) ON (n.name)
…and infers the type / property automatically.
Why it matters
This is one of the biggest friction points when porting an existing Neo4j codebase: every CREATE INDEX must be rewritten as a three-statement preamble, and the order matters. Migration tools (Liquibase-style, ETL bootstrap scripts) typically just issue the index DDL.
Expected
When Cypher CREATE INDEX ... FOR (n:Label) ON (n.prop) references a label or property that does not yet exist:
create the vertex/edge type if missing (defaulting to vertex unless context implies edge);
create the property with an inferred type (default ANY, or upgrade later on first insert);
then create the index.
If a property type is required for the index (e.g. FULL_TEXT, VECTOR), keep the current explicit-property requirement only for those cases and emit a clear error message.
Notes
Closely related to the cryptic "missing index type" error that was already improved in #4227 (df34542). This issue is the next-level UX gap: schema inference rather than just better errors.
Activity
test: added regression test for #4354
test: added regression test for ArcadeData#4354
test: added regression test for #4354