Getting the Most Out of Indexes

Default implementations for an index

As you can see when you execute SHOW INDEXES, the implementation of the index is shown.

The default Neo4j implementations for indexes are:

Index type Default implementation

Uniqueness constraint

range-1.0

Node key

range-1.0

RANGE

range-1.0

Composite index

range-1.0

TEXT index

text-1.0

Full-text

fulltext-1.0

Neo4j has its own implementation of range-1.0 which is internally a b-tree, and text-2.0 which is new in Neo4j 5. The fulltext-1.0 implementation uses lucene+native-3.0 (Apache Lucene).

With each release of Neo4j, there may be a new default implementation for an index so you should be aware of any migration of indexes that may be done between releases.

Customizing full-text indexes (Java)

Perhaps due to your application environment requirements or due to the type of data in your graph, you may choose to use a different implementation for your indexes that performs better using your use cases.

You can change the implementation used for full-text indexes as described here for Java applications.

Understanding limitations of indexes

Here is a helpful Knowledge-base article about the limitations of indexes in Neo4j. It refers to indexes in Neo4j 4, but some of the workarounds will also work in Neo4j 5.

Check your understanding

Index implementations

What default implementations does Neo4j currently use for indexes? (Select all that apply.)

  • ❏ b-tree

  • ✓ range-1.0

  • ❏ lucene-1.0

  • ❏ text

  • ✓ text-1.0

  • ✓ fulltext-1.0

Hint

At this writing, Neo4j has three implementations for indexes. You can see them with SHOW INDEXES.

Solution

The correct answers are:

  1. range-1.0

  2. text-1.0

  3. fulltext-1.0

Summary

In this lesson, you learned that you must fully understand the use and limitations of indexes for your application. This completes this course in Constraints and Indexes in Neo4j.