apoc.text.levenshteinDistance

Function APOC Core

apoc.text.levenshteinDistance(text1, text2) - compare the given strings with the Levenshtein distance algorithm.

Signature

apoc.text.levenshteinDistance(text1 :: STRING?, text2 :: STRING?) :: (INTEGER?)

Input parameters

Name Type Default

text1

STRING?

null

text2

STRING?

null

Usage Examples

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

0

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

2

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

13