PHPackages                             rishair/php-redis-autocomplete - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rishair/php-redis-autocomplete

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rishair/php-redis-autocomplete
==============================

Autocomplete implementation using PHP and Redis

18378[2 issues](https://github.com/rishair/php-redis-autocomplete/issues)PHP

Since Apr 22Pushed 13y ago3 watchersCompare

[ Source](https://github.com/rishair/php-redis-autocomplete)[ Packagist](https://packagist.org/packages/rishair/php-redis-autocomplete)[ RSS](/packages/rishair-php-redis-autocomplete/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Redis Autocomplete
==================

[](#redis-autocomplete)

Autocomplete implementation using PHP+Redis.

Inspired by

This library handles a basic implementation of autocomplete with sorted results (according to "scores") as well as arbitrary metadata for results. Also has the ability to separate different autocomplete databases in to "bins" (e.g. have separate bins "users" and another for "videos" so when querying against "users" it doesn't show results from "videos")

Getting started
---------------

[](#getting-started)

Start off by copying the file into your project and initiating a valid instance of Predis ().

Once the class is loaded, initiate a new instance of RedisAutocomplete

```
$auto = new RedisAutocomplete($predis, "users");

```

We'll use "users" as the bin (a category to classify this set of autocompletes) in this example

### Storing data

[](#storing-data)

To store data you must have a unique ID for an item and the phrase that should be searchable. You can optionally add a score that would effect the order that the item shows up in when being fetched. You also have the option of passing in an arbitrary data object that is converted to JSON and stored with the unique ID.

```
$auto->Store(2, "cat");
$auto->Store(3, "care");
$auto->Store(4, "caress");
$auto->Store(5, "cars");
$auto->Store(6, "camera");

```

### Retrieving data

[](#retrieving-data)

Fetching data is as easy as it gets:

```
$auto->Find("car");

```

Which returns

```
[3, 4, 5]

```

Copyright (c) 2011 Rishi Ishairzay, released under the MIT license

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/96d95fafa74da4882f9c3b3e18f278f901978c9b5a91c65efa471001ba17a89b?d=identicon)[VictorSigma](/maintainers/VictorSigma)

![](https://www.gravatar.com/avatar/31a3e339dbf136c8b092f01ef732edbe22b44689e1cb9c4b2f00a2b038946ce3?d=identicon)[rishair](/maintainers/rishair)

---

Top Contributors

[![rishair](https://avatars.githubusercontent.com/u/225732?v=4)](https://github.com/rishair "rishair (6 commits)")[![tonypiper](https://avatars.githubusercontent.com/u/206124?v=4)](https://github.com/tonypiper "tonypiper (3 commits)")

### Embed Badge

![Health badge](/badges/rishair-php-redis-autocomplete/health.svg)

```
[![Health](https://phpackages.com/badges/rishair-php-redis-autocomplete/health.svg)](https://phpackages.com/packages/rishair-php-redis-autocomplete)
```

###  Alternatives

[kongulov/interact-with-enum

Trait for convenient use of ENUM in PHP

3052.3k2](/packages/kongulov-interact-with-enum)[imi/laravel-transsid

Trans\_SID (Session IDs in URLs) for Laravel 5-8 Projects

183.2k](/packages/imi-laravel-transsid)

PHPackages © 2026

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