2017 © Pedro Peláez
 

library laravel-scout-tntsearch-driver

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

image

mgarcia96/laravel-scout-tntsearch-driver

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  • Wednesday, November 15, 2017
  • by magarrent
  • Repository
  • 1 Watchers
  • 0 Stars
  • 46 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 61 Forks
  • 0 Open issues
  • 37 Versions
  • 18 % Grown

The README.md

TNTSearch Driver for Laravel Scout - Laravel 5.3/5.4

Backers on Open Collective Sponsors on Open Collective Latest Version on Packagist Software License Build Status Quality Score Total Downloads, (*1)

This package makes it easy to add full text search support to your models with Laravel 5.3/5.4., (*2)

Support us on Patreon

Contents

Installation

You can install the package via composer:, (*3)

``` bash composer require teamtnt/laravel-scout-tntsearch-driver, (*4)


Add the service provider: ```php // config/app.php 'providers' => [ // ... TeamTNT\Scout\TNTSearchScoutServiceProvider::class, ],

Ensure you have Laravel Scout as a provider too otherwise you will get an "unresolvable dependency" error, (*5)

// config/app.php
'providers' => [
    // ...
    Laravel\Scout\ScoutServiceProvider::class,
],

Add SCOUT_DRIVER=tntsearch to your .env file, (*6)

Then you should publish scout.php configuration file to your config directory, (*7)

php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"

In your config/scout.php add:, (*8)


'tntsearch' => [ 'storage' => storage_path(), //place where the index files will be stored 'fuzziness' => env('TNTSEARCH_FUZZINESS', false), 'fuzzy' => [ 'prefix_length' => 2, 'max_expansions' => 50, 'distance' => 2 ], 'asYouType' => false, 'searchBoolean' => env('TNTSEARCH_BOOLEAN', false), ],

The asYouType option can be set per model basis, see example bellow, (*9)

Usage

After you have installed scout and the TNTSearch driver, you need to add the Searchable trait to your models that you want to make searchable. Additionaly, define the fields you want to make searchable by defining the toSearchableArray method on the model:, (*10)

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Laravel\Scout\Searchable;

class Post extends Model
{
    use Searchable;

    public $asYouType = true;

    /**
     * Get the indexable data array for the model.
     *
     * @return array
     */
    public function toSearchableArray()
    {
        $array = $this->toArray();

        // Customize array...

        return $array;
    }
}

Then, sync the data with the search service like:, (*11)

php artisan scout:import App\\Post, (*12)

If you have a lot of records and want to speed it up you can run:, (*13)

php artisan tntsearch:import App\\Post, (*14)

After that you can search your models with:, (*15)

Post::search('Bugs Bunny')->get();, (*16)

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor], (*17)

Credits

Contributors

This project exists thanks to all the people who contribute. , (*18)

Backers

Thank you to all our backers! 🙏 [Become a backer], (*19)

, (*20)

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor], (*21)

, (*22)

License

The MIT License (MIT). Please see License File for more information., (*23)

The Versions

15/11 2017

dev-master

9999999-dev

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

15/11 2017

v3.0.5

3.0.5.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

31/08 2017

v3.0.4

3.0.4.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

30/08 2017

v3.0.3

3.0.3.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

25/07 2017

v3.0.2

3.0.2.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

09/07 2017

v3.0.1

3.0.1.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

26/04 2017

v3.0.0

3.0.0.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

20/04 2017

v2.0.5

2.0.5.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

31/03 2017

v2.0.4

2.0.4.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

09/03 2017

v2.0.3

2.0.3.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

07/01 2017

v2.0.2

2.0.2.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

29/12 2016

v2.0.1

2.0.1.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

22/12 2016

v2.0.0

2.0.0.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

19/12 2016

v1.1.6

1.1.6.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

24/10 2016

v1.1.5

1.1.5.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

21/10 2016

v1.1.4

1.1.4.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

01/10 2016

v1.1.3

1.1.3.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

01/10 2016

dev-analysis-86331W

dev-analysis-86331W

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

21/09 2016

v1.1.2

1.1.2.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

18/09 2016

v1.1.1

1.1.1.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

18/09 2016

dev-analysis-8LmWkw

dev-analysis-8LmWkw

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

25/08 2016

v1.1.0

1.1.0.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

25/08 2016

dev-analysis-q1kD5w

dev-analysis-q1kD5w

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

25/08 2016

v1.0.9

1.0.9.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

25/08 2016

dev-analysis-qJD9xn

dev-analysis-qJD9xn

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

24/08 2016

v1.0.8

1.0.8.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

24/08 2016

dev-analysis-zY69Qj

dev-analysis-zY69Qj

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

23/08 2016

v1.0.7

1.0.7.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

23/08 2016

dev-analysis-8Pe7EL

dev-analysis-8Pe7EL

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

23/08 2016

v1.0.6

1.0.6.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

23/08 2016

v1.0.5

1.0.5.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

23/08 2016

v1.0.4

1.0.4.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

23/08 2016

v1.0.3

1.0.3.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

19/08 2016

v1.0.2

1.0.2.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

19/08 2016

dev-analysis-z3GJ69

dev-analysis-z3GJ69

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

16/08 2016

v1.0.1

1.0.1.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch

16/08 2016

v1.0.0

1.0.0.0

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by TNT Studio

laravel search scout tntsearch