Oihana PHP Arango

soundex.php

Table of Contents

Functions

soundex()  : string
Return the Soundex fingerprint of a value.

Functions

soundex()

Return the Soundex fingerprint of a value.

soundex(string $value) : string

This helper wraps the ArangoDB AQL function SOUNDEX(value) which returns the Soundex fingerprint of a string. Soundex is a phonetic algorithm for indexing names by sound, as pronounced in English.

Example AQL usage:

SOUNDEX("Smith")              // returns "S530"
SOUNDEX("Smyth")              // returns "S530" (same as Smith)
SOUNDEX("Johnson")            // returns "J525"
SOUNDEX(doc.name)             // returns Soundex code of name
Parameters
$value : string

String expression to calculate Soundex for.

Tags
example
use function oihana\arango\db\functions\strings\soundex;

$expr = soundex('doc.name');
// Produces: 'SOUNDEX(doc.name)'
see
https://docs.arangodb.com/stable/aql/functions/string/#soundex
https://en.wikipedia.org/wiki/Soundex
since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results