PHPackages                             chris48s/cakephp-searchable - 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. chris48s/cakephp-searchable

ActiveCakephp-plugin[Database &amp; ORM](/categories/database)

chris48s/cakephp-searchable
===========================

A CakePHP 3 Behavior for creating MySQL MATCH() AGAINST() queries

3.0.0(4y ago)45.3k4[2 issues](https://github.com/chris48s/cakephp-searchable/issues)MITPHPPHP &gt;=5.6

Since Jan 9Pushed 4y ago5 watchersCompare

[ Source](https://github.com/chris48s/cakephp-searchable)[ Packagist](https://packagist.org/packages/chris48s/cakephp-searchable)[ Docs](https://github.com/chris48s/cakephp-searchable)[ RSS](/packages/chris48s-cakephp-searchable/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (4)Versions (5)Used By (0)

[![Build Status](https://camo.githubusercontent.com/52bc2e1c8664f3f60d410bc8b4b4c22df38c772f7c8af5bb370ad520fe88e264/68747470733a2f2f7472617669732d63692e6f72672f63687269733438732f63616b657068702d73656172636861626c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/chris48s/cakephp-searchable)[![Coverage Status](https://camo.githubusercontent.com/e47400f06c04d404e2e38ec9aa00109fc9cf051a08faadca42bcac84717e629b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f63687269733438732f63616b657068702d73656172636861626c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/chris48s/cakephp-searchable?branch=master)

CakePHP Searchable Behavior Plugin
==================================

[](#cakephp-searchable-behavior-plugin)

A CakePHP 3 Behavior for creating MySQL [MATCH() AGAINST() queries](https://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html).

CakePHP-Searchable adds a custom `find('matches')` method to your CakePHP models, alleviating the need to pass raw SQL into your queries. It is safe against SQL injection and uses a query syntax which is consistent with the conventions of CakePHP's ORM.

Installation
------------

[](#installation)

Install from [packagist](https://packagist.org/packages/chris48s/cakephp-searchable) using [composer](https://getcomposer.org/). Add the following to your `composer.json`:

```
"require": {
    "chris48s/cakephp-searchable": "^2.0.0"
}

```

and run `composer install` or `composer update`, as applicable.

Database Support
----------------

[](#database-support)

In order to use FULLTEXT indexes on InnoDB tables, you must be using MySQL &gt;=5.6.4. Earlier versions only allow use of FULLTEXT indexes on MyISAM tables.

Usage
-----

[](#usage)

### Loading the plugin

[](#loading-the-plugin)

Add the code `Plugin::load('Chris48s/Searchable');` to your `bootstrap.php`.

### Using the Behavior

[](#using-the-behavior)

Add the behavior in your table class.

```
