apoc.text.levenshteinDistance

Details

Syntax

apoc.text.levenshteinDistance(text1, text2)

Description

Compares the given STRING values using the Levenshtein distance algorithm.

Arguments

Name

Type

Description

text1

STRING

The first string to be compared against the second.

text2

STRING

The second string to be compared against the first.

Returns

INTEGER

Usage Examples

RETURN apoc.text.levenshteinDistance("Neo4j", "Neo4j") AS output;
Results
output

0

RETURN apoc.text.levenshteinDistance("Neo4j", "Neoj4") AS output;
Results
output

2

RETURN apoc.text.levenshteinDistance("Neo4j Aura", "Neo4j Graph Database") AS output;
Results
output

13