<commit_before>Laravel 4+ Searchy
========================================
### Database Searching Made Easy

Searchy is an easy-to-use Laravel 4+ package that makes running user driven searches on data in your models simple and effective.
It uses pseudo fuzzy searching and other weighted mechanics depending on the search driver that you have enabled.
It requires no other software installed on your server (so a bit slower than dedicated search programs) but can be set up and ready to go in minutes.

Installation
----------------------------------------
Add `"tom-lingham/searchy" : "dev-master"` to your composer.json file under `require`:
```
"require": {
	"laravel/framework": "4.*",
	"tom-lingham/searchy" : "dev-master"
}
```
Run `composer update` in your terminal to pull the package down into your vendors folder.

Add the service provider to the `providers` array in Laravel's app/config/app.php file:
```php
'TomLingham\Searchy\SearchyServiceProvider'
```

Add the Alias to the `aliases` array in Laravel's app/config/app.php file:
```php
'Searchy' => 'TomLingham\Searchy\SearchBuilder'
```


Usage
----------------------------------------
To use Searchy, you can take advantage of magic methods.

If you are searching the name column/field of users in a `users` table you would, for example run:
```php
$users = Searchy::users('name')->query('<NAME>');
```
you can also write this as:

```php
$users = Searchy::search('users')->query('<NAME>');
```
These example both return a Laravel DB Query Builder Object, so you will need to chain `get()` to actually return the results in a usable object:

```php
$users = Searchy::search('users')->query('<NAME>')->get();
```

#### Searching multiple Columns
You can also add multiple arguments ot the list fo fields/columns ot search by.

For example, if you want to search the name, email address and username of a user, you might run:
```php
$users = Searchy::users('name', 'email', 'username')->query('<NAME>');
```


Configuration
----------------------------------------
You can publish the configuration file to your `app` directory and override the settings by running `php artisan config:publish tom-lingham/searchy`

You can set the default driver to use for searches in the configuration file. Your options (At this stage) are: `fuzzy`, `simple` and `levenshtein`.
<commit_msg>Updated readme to fix error in method chaining logic #1<commit_after>Laravel 4+ Searchy
========================================
### Database Searching Made Easy

Searchy is an easy-to-use Laravel 4+ package that makes running user driven searches on data in your models simple and effective.
It uses pseudo fuzzy searching and other weighted mechanics depending on the search driver that you have enabled.
It requires no other software installed on your server (so a bit slower than dedicated search programs) but can be set up and ready to go in minutes.

Installation
----------------------------------------
Add `"tom-lingham/searchy" : "dev-master"` to your composer.json file under `require`:
```
"require": {
	"laravel/framework": "4.*",
	"tom-lingham/searchy" : "dev-master"
}
```
Run `composer update` in your terminal to pull the package down into your vendors folder.

Add the service provider to the `providers` array in Laravel's app/config/app.php file:
```php
'TomLingham\Searchy\SearchyServiceProvider'
```

Add the Alias to the `aliases` array in Laravel's app/config/app.php file:
```php
'Searchy' => 'TomLingham\Searchy\SearchBuilder'
```


Usage
----------------------------------------
To use Searchy, you can take advantage of magic methods.

If you are searching the name column/field of users in a `users` table you would, for example run:
```php
$users = Searchy::users('name')->query('<NAME>');
```
you can also write this as:

```php
$users = Searchy::search('users')->fields('name', 'email')->query('<NAME>');
```
In this case, pass the columns you want to search through to the `fields()` method.

These example both return a Laravel DB Query Builder Object, so you will need to chain `get()` to actually return the results in a usable object:

```php
$users = Searchy::search('users')->fields('name', 'email')->query('<NAME>')->get();
```

#### Searching multiple Columns
You can also add multiple arguments ot the list fo fields/columns ot search by.

For example, if you want to search the name, email address and username of a user, you might run:
```php
$users = Searchy::users('name', 'email', 'username')->query('John Smith');
```


Configuration
----------------------------------------
You can publish the configuration file to your `app` directory and override the settings by running `php artisan config:publish tom-lingham/searchy`

You can set the default driver to use for searches in the configuration file. Your options (At this stage) are: `fuzzy`, `simple` and `levenshtein`.

{'fraction_non_alphanumeric': 0.17040082219938335, 'fraction_numerical': 0.0014388489208633094, 'mean_word_length': 3.856287425149701, 'pattern_counts': {'":': 4, '<': 10, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7670641', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1255, 'n_words': 603}