PHPackages                             markusos/simple-search - 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. [Search &amp; Filtering](/categories/search)
4. /
5. markusos/simple-search

ActiveLibrary[Search &amp; Filtering](/categories/search)

markusos/simple-search
======================

Simple Search Engine in PHP

8161PHP

Since Mar 29Pushed 9y ago3 watchersCompare

[ Source](https://github.com/markusos/simple-search)[ Packagist](https://packagist.org/packages/markusos/simple-search)[ RSS](/packages/markusos-simple-search/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Simple Search
=============

[](#simple-search)

[![Code Climate](https://camo.githubusercontent.com/e453b86e0a5ece640c485d42dbc2e365e4c5838e7d3a68c4032caa336bc1fafb/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d61726b75736f732f73696d706c652d7365617263682d7068702f6261646765732f6770612e737667)](https://codeclimate.com/github/markusos/simple-search)[![Test Coverage](https://camo.githubusercontent.com/77fb06bbe843519e444f5773fc434221808be04b76bde8b7eb0977101b4a3332/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d61726b75736f732f73696d706c652d7365617263682d7068702f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/markusos/simple-search)[![Build Status](https://camo.githubusercontent.com/04948f9ebfcce475d780087f951ade103eb0c2e0bef353b492d7047b49a4bc0e/68747470733a2f2f7472617669732d63692e6f72672f6d61726b75736f732f73696d706c652d7365617263682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/markusos/simple-search)[![License](https://camo.githubusercontent.com/bbcc1e981dbb2c68fe049327dd54c32e1a2a1b7db5fa23603e2f3b480e076bf3/68747470733a2f2f706f7365722e707567782e6f72672f6d61726b75736f732f73696d706c652d7365617263682f6c6963656e73652e737667)](https://packagist.org/packages/markusos/simple-search)

A Simple Search Engine in PHP

- Query the document index using multi word queries.
- Search result is ranked with TF-IDF term weighting and cosine similarity.
- Uses MongoDB, MySQL or SQLite to store the documents.
- Stores the search index in Memcached or MongoDB.
- Easily extensible to support other storage providers.
- Uses Snowball- or Porter-stemming of tokens.

**NOTE: this project is still in development**

### Install

[](#install)

```
$ composer require markusos/simple-search dev-master
```

When running the Search Engine make sure that the MongoDB and Memcached processes are running on the server.

### System Requirements

[](#system-requirements)

You need **PHP &gt;= 5.4.0** to use `markusos\simple-search` but the latest stable version of PHP is recommended.

If you want to use the MongoDB storage and/or index providers, you need to install the `mongo` extension.

```
$ pecl install mongo
```

To use the snowball stemmer you also need to install the `stem` extension.

```
$ pecl install stem
```

Make sure that you install the languages that you need when installing the `stem` extension.

### Usage

[](#usage)

#### Basic usage

[](#basic-usage)

**Index document:**

```
