Graph index

Description

The Graph index action (previously Neo4j index) creates or drops indexes on node or relationship properties in a graph database, in the syntax of the database: Neo4j, Memgraph, FalkorDB or Apache AGE.

For similar operations on constraints, check the Graph constraint action.

Options

  • Graph database connection : The name of the graph database connection to update indexes on

  • Index updates to perform: You can specify your list of index updates here

    • Update type : CREATE or DROP

    • Type of object to index on: NODE or RELATIONSHIP

    • Index name: optional but recommended name for your index

    • Object name: the label of the node or relationship you want to update an index for

    • Properties: the comma separated list of node or relationship properties to index

    • Index type: RANGE for a regular property index (the default), VECTOR for a vector index

    • Vector dimensions: VECTOR only, the number of numbers in each vector, for example 768 for nomic-embed-text

    • Vector similarity: VECTOR only, COSINE (the default) or EUCLIDEAN

    • Vector capacity: VECTOR on Memgraph only, the number of vectors to reserve room for, 1000 when empty

The index name, object name, properties, vector dimensions and vector capacity can be variables, for example ${CHUNK_INDEX} to keep a test and a production index apart. The action resolves them before it builds the statement, for create and drop, and the Cypher preview shows the resolved values. Use the same variable for the index name in Graph vector search.

Databases

Database Range index Vector index

Neo4j

Nodes and relationships

Nodes and relationships

Memgraph

Nodes and relationships

Nodes and relationships

FalkorDB

Nodes and relationships

Nodes and relationships

Apache AGE

Nodes, with a name

No

Amazon Neptune, Gremlin

No

No

On Apache AGE an index is a PostgreSQL index on the table of the label, created and dropped with SQL. The action creates the label first when there are no nodes with it yet, so the index can be created before the data is loaded.

Vector indexes

A vector index is on a single property holding embeddings, see Vectors and embeddings. Neo4j, Memgraph and FalkorDB have vector indexes; the action refuses them on the other databases.

Database Notes

Neo4j

Vector indexes on nodes and relationships, CREATE VECTOR INDEX …​ FOR ()-[n:TYPE]-() for relationships. Drop them by name.

Memgraph

Vector indexes on nodes and, from Memgraph 3, relationships (CREATE VECTOR EDGE INDEX), with a name, which you also drop them by. EUCLIDEAN uses Memgraph’s l2sq metric.

FalkorDB

Vector indexes on nodes and relationships, identified by label or relationship type and property like its other indexes.

For a vector index on relationships set the type of object to RELATIONSHIP and the object name to the relationship type. Search it with the Graph vector search transform, Search set to RELATIONSHIP.

Show Cypher Preview

The action dialog includes a "Show Cypher" button that displays a preview of the Cypher statements that will be executed for creating or dropping indexes. This preview shows the exact CREATE INDEX or DROP INDEX statements before execution.

The preview is read-only and helps you verify the index operations that will be performed.