PHPackages                             fza/mysql-doctrine-levenshtein-function - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. fza/mysql-doctrine-levenshtein-function

ActiveLibrary[Database &amp; ORM](/categories/database)

fza/mysql-doctrine-levenshtein-function
=======================================

Provides the `LEVENSHTEIN()` and `LEVENSHTEIN\_RATIO()` MySQL functions for Doctrine2.

v0.3(11y ago)47115.8k↓29.1%8[1 PRs](https://github.com/fza/mysql-doctrine-levenshtein-function/pulls)1MITPHP

Since May 7Pushed 10y ago1 watchersCompare

[ Source](https://github.com/fza/mysql-doctrine-levenshtein-function)[ Packagist](https://packagist.org/packages/fza/mysql-doctrine-levenshtein-function)[ RSS](/packages/fza-mysql-doctrine-levenshtein-function/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (1)

Levenshtein distance function for Doctrine and MySQL
====================================================

[](#levenshtein-distance-function-for-doctrine-and-mysql)

A tiny Doctrine extension for the [Levenshtein distance](http://en.wikipedia.org/wiki/Levenshtein_distance) algorithm to be used directly in DQL. The `LEVENSHTEIN(s1, s2)` function returns the number of add, replace and delete operations needed to transform one string into another. The `LEVENSHTEIN_RATIO(s1, s2)` function returns the similarity of two strings in percent (`0 createQuery('SELECT u FROM User u WHERE LEVENSHTEIN_RATIO(u.name, :nameQuery) > :minSimilarity');
$query->setParameter('nameQuery', 'michael');
$query->setParameter('minSimilarity', 50)
$matchingUsers = $query->getResult();
```

License
-------

[](#license)

Copyright (c) 2015 [Felix Zandanel](http://felix.zandanel.me/)
Licensed under the MIT license.

See LICENSE for more info.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~341 days

Total

3

Last Release

4078d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27446c4ce98055d35b8f113d4f6ca921003611fd7f223ca1c53b4ce10d023cd6?d=identicon)[fza](/maintainers/fza)

---

Top Contributors

[![fza](https://avatars.githubusercontent.com/u/578502?v=4)](https://github.com/fza "fza (9 commits)")[![afoeder](https://avatars.githubusercontent.com/u/1125168?v=4)](https://github.com/afoeder "afoeder (1 commits)")[![zhil](https://avatars.githubusercontent.com/u/981783?v=4)](https://github.com/zhil "zhil (1 commits)")

---

Tags

mysqldoctrinefunctionsimilaritylevenshtein

### Embed Badge

![Health badge](/badges/fza-mysql-doctrine-levenshtein-function/health.svg)

```
[![Health](https://phpackages.com/badges/fza-mysql-doctrine-levenshtein-function/health.svg)](https://phpackages.com/packages/fza-mysql-doctrine-levenshtein-function)
```

###  Alternatives

[oro/doctrine-extensions

Doctrine Extensions for MySQL and PostgreSQL.

34411.8M19](/packages/oro-doctrine-extensions)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58723.9M36](/packages/scienta-doctrine-json-functions)[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4636.8M12](/packages/fresh-doctrine-enum-bundle)[mapado/mysql-doctrine-functions

MySQL Function for Doctrine : RAND(), ROUND() DATE(), DATE\_FORMAT()...

44271.5k1](/packages/mapado-mysql-doctrine-functions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
