How to perform a Soundex search

Using apoc.text.phonetic one can perform a
Soundex search. For example if one defines the following nodes

CREATE (n:Person {name:'Anders'})
CREATE (m:Person {name:'Andrew'})
CREATE (p:Person {name:'Andres'})

then to find these 3 nodes, since they all have the same Soundex value as Andre, one can run


CALL apoc.text.phonetic('Andre') YIELD value
WITH value AS search_str
MATCH (n:Person)
CALL apoc.text.phonetic(n.name) YIELD value
WITH value AS match_str, search_str, n
WHERE search_str = match_str
RETURN n