PHPackages                             phoenixsearch/phoenixsearch - 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. [Caching](/categories/caching)
4. /
5. phoenixsearch/phoenixsearch

ActivePhoenixsearch[Caching](/categories/caching)

phoenixsearch/phoenixsearch
===========================

PhoenixSearch is a fast and modern full-text real-time search engine based on Redis + PHP7

0.4.1(8y ago)616[3 issues](https://github.com/phoenixsearch/phoenixsearch/issues)MITPHPPHP ^7.0

Since Aug 19Pushed 8y ago3 watchersCompare

[ Source](https://github.com/phoenixsearch/phoenixsearch)[ Packagist](https://packagist.org/packages/phoenixsearch/phoenixsearch)[ RSS](/packages/phoenixsearch-phoenixsearch/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (6)Dependencies (4)Versions (8)Used By (0)

PhoenixSearch
=============

[](#phoenixsearch)

PhoenixSearch is a fast and modern full-text real-time search engine based on Redis + PHP7

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f9a82e106a08bf5df0b41405d158e2df3dd463fc1823e93c9cb2e589a6690300/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70686f656e69787365617263682f70686f656e69787365617263682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phoenixsearch/phoenixsearch/?branch=master)[![Build Status](https://camo.githubusercontent.com/4c483b86cc75556ea4e6eb5c938d94b4d60b215fe38bb125f22b7c58869c4567/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70686f656e69787365617263682f70686f656e69787365617263682f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phoenixsearch/phoenixsearch/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/6c7e40dd264b83932352f580bcb47b31113fedbdc61cfb30989e96883d6540a9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70686f656e69787365617263682f70686f656e69787365617263682f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phoenixsearch/phoenixsearch/?branch=master)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://opensource.org/licenses/MIT)

[![alt Redis logo](https://github.com/phoenixsearch/phoenixsearch/raw/master/tests/images/redis.png)](https://github.com/phoenixsearch/phoenixsearch/blob/master/tests/images/redis.png)[![alt PHP logo](https://github.com/phoenixsearch/phoenixsearch/raw/master/tests/images/php.png)](https://github.com/phoenixsearch/phoenixsearch/blob/master/tests/images/php.png)

- [Installation](#user-content-installation-via-composer)
- [Index document](#user-content-index-document)
- [Search documents](#user-content-search-documents)
    - [Search with offset/limit](#user-content-search-with-offset/limit)
    - [Search with highlighted query](#user-content-search-with-highlighted-query)
- [Delete document](#user-content-delete-document)
- [Delete index](#user-content-delete-index)
- [Reindex](#user-content-reindex)
- [Getting indices info](#user-content-getting-indices-info)
- [Getting detailed index info](#user-content-getting-detailed-index-info)

### Installation via composer

[](#installation-via-composer)

```
composer create-project phoenixsearch/phoenixsearch yourprojectpath/
```

then cd to yourprojectpath/ and run:

```
php phoenixsearchd.php
```

the key is in Your `.env` file.

PS you need `phoenixsearchd` to execute long running complicated tasks ex.: delete an entire index, reindex data to another index/indexType etc

It is possible to identify the process by it's title:

```
ps aux | grep phoenixsearch
```

### Index document

[](#index-document)

Index a new document into the storage and increments `docs_count` in index info.

Request:

```
PUT http://pheonixsearch.loc/myindex/myindextype?pretty
```

```
{
  "title": "Lorem ipsum is a pseudo-Latin text",
  "text": "Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero. Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found in the original."
}
```

Response:

```
{
    "created": true,
    "took": 23,
    "_index": "myindex",
    "_type": "myindextype",
    "_id": 2,
    "result": "created",
    "_version": 1
}
```

#### Update document with same content (idempotent operation).

[](#update-document-with-same-content-idempotent-operation)

If an update with the same content occurred, then this document will be found and `_version`property will be updated to `i++`.

Request:

```
PUT http://pheonixsearch.loc/myindex/myindextype?pretty
```

```
{
  "title": "Lorem ipsum is a pseudo-Latin text",
  "text": "Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero. Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found in the original."
}
```

Response:

```
{
    "created": false,
    "took": 1,
    "_index": "myindex",
    "_type": "myindextype",
    "_id": 1,
    "result": "updated",
    "_version": 2
}
```

### Search documents

[](#search-documents)

Whether you need to search by word or phrase just add `query->term` into json body.

Request:

```
GET http://pheonixsearch.loc/myindex/myindextype?pretty
```

```
{
    "query" : {
        "term" : { "title" : "Lorem ipsum" }
    }
}
```

Response:

```
{
    "took": 1,
    "timed_out": false,
    "hits": {
        "total": 2,
        "hits": [
            {
                "_index": "myindex",
                "_type": "myindextype",
                "_id": 1,
                "_timestamp": 1502997604,
                "_source": {
                    "title": "Lorem ipsum is a pseudo-Latin text",
                    "text": "Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero. Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found in the original."
                }
            },
            {
                "_index": "myindex",
                "_type": "myindextype",
                "_id": 2,
                "_timestamp": 1502997883,
                "_source": {
                    "title": "Lorem ipsum is a pseudo-Latin text used in web design",
                    "text": "Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero. Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found in the original."
                }
            }
        ]
    }
}
```

#### Search with offset/limit

[](#search-with-offsetlimit)

By offsetting the search request (like in sql) you saying to engine - start collecting documents from J, for amount of K if limit was set.

Request:

```
GET http://pheonixsearch.loc/myindex/myindextype?pretty
```

```
{
    "offset":10,
    "limit":5,
    "query" : {
        "term" : { "text" : "quis" }
    }
}
```

Response:

```
{
    "took": 11,
    "timed_out": false,
    "hits": {
        "total": 5,
        "hits": [
            {
                "_index": "myindex",
                "_type": "myindextype",
                "_id": 695,
                "_timestamp": 1503231848,
                "_source": {
                    "title": "Ms.",
                    "text": "Et aut et dolor assumenda ea. Iste corrupti quis quis voluptas similique quos tenetur. Et nisi dolore quod quidem architecto qui."
                }
            },
            {
                "_index": "myindex",
                "_type": "myindextype",
                "_id": 2027,
                "_timestamp": 1503231889,
                "_source": {
                    "title": "Dr.",
                    "text": "Quae ut ad omnis est. Impedit reiciendis illo aut magnam fugit. Sed ratione illum quibusdam illum et dolores quis quia."
                }
            },
            {
                "_index": "myindex",
                "_type": "myindextype",
                "_id": 4506,
                "_timestamp": 1503232042,
                "_source": {
                    "title": "Dr.",
                    "text": "Necessitatibus quod est commodi accusamus. Occaecati quis nam veritatis quia. Dicta a non ex non repellendus sed ipsa. Molestiae aliquam quia dolor porro laboriosam corporis consequatur."
                }
            },
            {
                "_index": "myindex",
                "_type": "myindextype",
                "_id": 4568,
                "_timestamp": 1503232046,
                "_source": {
                    "title": "Dr.",
                    "text": "Magnam quis nihil aliquid nihil enim. Ad id odio tenetur aut. Nihil ea iusto aliquam ut."
                }
            },
            {
                "_index": "myindex",
                "_type": "myindextype",
                "_id": 7398,
                "_timestamp": 1503232264,
                "_source": {
                    "title": "Mrs.",
                    "text": "Non adipisci sunt quisquam sint ullam qui sed. Ut voluptate eum quia quia. Nihil blanditiis eos quis fuga unde reprehenderit veritatis voluptatem. Dolorum neque temporibus vel reiciendis voluptatem."
                }
            }
        ]
    }
}
```

#### Search with highlighted query

[](#search-with-highlighted-query)

When you need to highlight words, phrases etc, it is simple enough to do by adding `highlight` property into json scheme.

```
{
    "offset":5,
    "limit":5,
    "highlight" : {
        "pre_tags" : ["", ""],
        "post_tags" : ["", ""],
        "fields" : {
            "name" : {}, "text" : {}
        }
    },
    "query" : {
        "term" : { "text" : "quis enim" }
    }
}
```

```
{
    "took": 46,
    "timed_out": false,
    "hits": {
        "total": 5,
        "hits": [
            {
                "_index": "myindex",
                "_type": "myindextype",
                "_id": "7483",
                "_timestamp": "1503232272",
                "_source": {
                    "title": "Dr.",
                    "text": "Pariatur aut consequatur cumque dolores. Hic quis tempora quia error suscipit quis enim omnis. Et ut aperiam voluptatum officia rem vitae quod. Cupiditate qui et commodi est quod."
                }
            },
            {
                "_index": "myindex",
                "_type": "myindextype",
                "_id": "3973",
                "_timestamp": "1503232006",
                "_source": {
                    "title": "Prof.",
                    "text": "Corporis provident tempore omnis voluptatem voluptates distinctio aliquam voluptatem. Non quis quis enim nulla aliquid quidem eligendi. Rerum et mollitia consequuntur consequatur."
                }
            },
            {
                "_index": "myindex",
                "_type": "myindextype",
                "_id": "3276",
                "_timestamp": "1503231961",
                "_source": {
                    "title": "Miss",
                    "text": "Distinctio voluptatem autem exercitationem quo cumque. Labore omnis sapiente qui itaque. Sunt iusto et porro id quis enim corrupti. Quaerat id doloribus est adipisci et debitis voluptas."
                }
            },
            {
                "_index": "myindex",
                "_type": "myindextype",
                "_id": "3827",
                "_timestamp": "1503231997",
                "_source": {
                    "title": "Dr.",
                    "text": "Iure est culpa vitae blanditiis explicabo voluptatem aliquam. Nostrum ullam quo ipsum reprehenderit magni officiis dolor. Quo quis enim facilis quidem facilis quaerat."
                }
            },
            {
                "_index": "myindex",
                "_type": "myindextype",
                "_id": "9524",
                "_timestamp": "1503232463",
                "_source": {
                    "title": "Miss",
                    "text": "Nam dolorem et laboriosam quis enim voluptas. Rerum vel nihil delectus fugit qui. Tempore quis commodi error provident aperiam esse. Dolorum nulla ipsa molestias veritatis dolorem sed distinctio."
                }
            }
        ]
    }
}
```

### Delete document

[](#delete-document)

Deletes one document by it's id, decreasing counter in index info by 1.

```
DELETE http://pheonixsearch.loc/myindex/myindextype/2?pretty
```

For existing document it returns:

```
{
    "found": true,
    "took": 6,
    "_index": "myindex",
    "_type": "myindextype",
    "_id": 2,
    "result": "deleted",
    "_version": 1
}
```

For non-existent document:

```
{
    "found": false,
    "took": 1,
    "_index": "myindex",
    "_type": "myindextype",
    "_id": 2,
    "result": "not found",
    "_version": 1
}
```

### Delete index

[](#delete-index)

Deletes an entire index data from storage.

```
DELETE http://pheonixsearch.loc/myindex/myindextype
```

Response:

```
{
    "acknowledged": true
}
```

The message `"acknowledged": true` means the job is processed under the daemon `phoenixsearchd`.

### Reindex

[](#reindex)

Copies documents from one index to another with mappings of source index by default.

```
POST http://pheonixsearch.loc/_reindex
```

```
{
  "source": {
    "index": "myindex",
    "index_type":"myindextype"
  },
  "dest": {
    "index": "myanotherindex",
    "index_type":"myanothertype"
  }
}
```

Response:

```
{
    "acknowledged": true
}
```

### Getting indices info

[](#getting-indices-info)

This request will output general information about all indices, that has been stored yet.

```
GET http://pheonixsearch.loc/_cat/indices
```

```
[
    {
        "store_size": "456.91M"
    },
    {
        "_index": "myanotherindex",
        "docs_count": 2,
        "docs_deleted": 0
    },
    {
        "_index": "myindex",
        "docs_count": 12687,
        "docs_deleted": 1
    }
]
```

The `store_size` is the size of storage for all indices got from Redis.

### Getting detailed index info

[](#getting-detailed-index-info)

```
GET http://pheonixsearch.loc/myindex
```

```
{
    "myindex": {
        "aliases": [],
        "mappings": {
            "myindextype": {
                "properties": {
                    "title": {
                        "type": "text",
                        "fields": {
                            "whitespace": {
                                "type": "whitespace",
                                "ignore_above": 0
                            }
                        }
                    },
                    "text": {
                        "type": "text",
                        "fields": {
                            "whitespace": {
                                "type": "whitespace",
                                "ignore_above": 0
                            }
                        }
                    },
                    "data": {
                        "type": "text",
                        "fields": {
                            "whitespace": {
                                "type": "whitespace",
                                "ignore_above": 0
                            }
                        }
                    }
                }
            }
        }
    }
}
```

`"ignore_above": 0` means no restriction on string(text) length is applied, `whitespace` type is the default type of inverted index analyzer which just breaks text by whitespace tokens.

### Performance

[](#performance)

#### Full-text search with offset/limit + highlighting (by phrase)

[](#full-text-search-with-offsetlimit--highlighting-by-phrase)

Request:

```
{
    "offset":5,
    "limit":10,
    "highlight" : {
        "pre_tags" : ["", ""],
        "post_tags" : ["", ""],
        "fields" : {
            "name" : {}, "text" : {}
        }
    },
    "query" : {
        "term" : { "text" : "quis enim" }
    }
}
```

Response:

```
{
    "took": 57,
    "timed_out": false,
    "hits": {
        "total": 10 ...
```

#### Full-text search with offset/limit (by phrase)

[](#full-text-search-with-offsetlimit-by-phrase)

Request:

```
{
    "offset":5,
    "limit":10,
    "query" : {
        "term" : { "text" : "quis enim" }
    }
}
```

Response:

```
{
    "took": 34,
    "timed_out": false,
    "hits": {
        "total": 10 ...
```

#### Full-text search without restriction for 1 000 000 documents by phrase

[](#full-text-search-without-restriction-for-1-000-000-documents-by-phrase)

Request:

```
{
    "query" : {
        "term" : { "text" : "quis enim" }
    }
}
```

Response:

```
{
    "took": 72,
    "timed_out": false,
    "hits": {
        "total": 229 ...
```

#### Full-text search without restriction for 1 000 000 documents by word

[](#full-text-search-without-restriction-for-1-000-000-documents-by-word)

Request:

```
{
    "query" : {
        "term" : { "text" : "quis" }
    }
}
```

Response:

```
{
    "took": 49,
    "timed_out": false,
    "hits": {
        "total": 2450 ...
```

As You can see selection is blazingly fast, no magic - just Redis with native C as core.

#### Put a document into the index with type

[](#put-a-document-into-the-index-with-type)

Request:

```
{
  "title": "Lorem ipsum is a pseudo-Latin text used in web design",
  "text": "Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero. Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found in the original.",
  "data": "2017-08-21"
}
```

Response:

```
{
    "created": true,
    "took": 66 ...
}
```

#### Deleting document

[](#deleting-document)

Request:

```
http://pheonixsearch.loc/myindex/myindextype/44972?pretty
```

Response:

```
{
    "found": true,
    "took": 33 ...
```

### Notes

[](#notes)

- `took` time measured in milliseconds

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~3 days

Total

6

Last Release

3221d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f7457ca41f3ffc690f41a6035fdeb4ab8eced3871a3061a638fd8dc80343588?d=identicon)[arthurkushman](/maintainers/arthurkushman)

---

Top Contributors

[![arthurkushman](https://avatars.githubusercontent.com/u/2669610?v=4)](https://github.com/arthurkushman "arthurkushman (125 commits)")

---

Tags

full-textfull-text-searchphpphp7redissearchsearch-engine

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phoenixsearch-phoenixsearch/health.svg)

```
[![Health](https://phpackages.com/badges/phoenixsearch-phoenixsearch/health.svg)](https://phpackages.com/packages/phoenixsearch-phoenixsearch)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.2k](/packages/unopim-unopim)[rhubarbgroup/redis-cache

A persistent object cache backend for WordPress powered by Redis. Supports Predis, PhpRedis, Relay, replication, sentinels, clustering and WP-CLI.

52699.8k1](/packages/rhubarbgroup-redis-cache)[symfony-bundles/redis-bundle

Symfony Redis Bundle

271.2M6](/packages/symfony-bundles-redis-bundle)[pdffiller/qless-php

PHP Bindings for qless

29113.7k1](/packages/pdffiller-qless-php)[millipress/millicache

WordPress Full-Page Cache based on Rules &amp; Flags. Delivers flexible, scalable caching workflows backed by Redis and ValKey in-memory stores.

712.0k2](/packages/millipress-millicache)

PHPackages © 2026

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