2017 © Pedro Peláez
 

project searchlight

Search query language for Laravel supporting Eloquent and Elasticsearch

image

naph/searchlight

Search query language for Laravel supporting Eloquent and Elasticsearch

  • Friday, July 27, 2018
  • by Naph
  • Repository
  • 2 Watchers
  • 2 Stars
  • 698 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 16 Versions
  • 7 % Grown

The README.md

Searchlight

An Elasticsearch search query language for Laravel featuring multi-model search, (*1)

public function search(Search $search, Comment $comments, Post $posts)
{
    return $search->in($comments, $posts)
        ->match('Searchlight')
        ->get();
}

and built-in qualifier reducers., (*2)

$driver->qualifier('/#(\w+)/', function (Search $search, $fragment) {
    $search->filter(['tags' => $fragment]);
});

Install

Using composer, (*3)

composer require naph/searchlight

Register the service provider, (*4)

Naph\Searchlight\SearchlightServiceProvider;

Publish vendor files containing driver and host configuration. Lumen users should copy the file instead., (*5)

php artisan vendor:publish --tag searchlight

Setup models by implementing the contract/trait pair and overriding getSearchableFields. The trait binds events to saved and deleted so indices are kept in sync with your database., (*6)


use Illuminate\Database\Eloquent\Model; use Naph\Searchlight\Model\SearchlightContract; use Naph\Searchlight\Model\SearchlightTrait; class Topic extends Model implements SearchlightContract { use SearchlightTrait; public function getSearchableFields(): array { return [ 'title' => 1, 'description' => 0.5, 'content' => 0.1 ]; } }

Storing this model's fully qualified classname in searchlight.repositories config ensures their indices are built when running:, (*7)

php artisan searchlight:rebuild

This command destroys all existing indexed documents in the process., (*8)

Requirements

Currently only supports PHP7 and latest versions of Laravel and Lumen., (*9)

License

Searchlight is an open-sourced software licensed under the MIT license., (*10)

The Versions

27/07 2018

dev-develop

dev-develop

Search query language for Laravel supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

24/08 2017

0.6.0

0.6.0.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

24/08 2017

dev-master

9999999-dev

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

24/08 2017

0.5.6

0.5.6.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

07/08 2017

0.5.5

0.5.5.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

01/08 2017

0.5.4

0.5.4.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

31/07 2017

0.5.3

0.5.3.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

31/07 2017

0.5.2

0.5.2.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

31/07 2017

0.5.1

0.5.1.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

08/06 2017

0.5.0

0.5.0.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

07/06 2017

0.4.1

0.4.1.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

07/06 2017

0.4.0

0.4.0.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

05/06 2017

0.3.0

0.3.0.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

30/05 2017

0.2.1

0.2.1.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

27/05 2017

0.2.0

0.2.0.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph

25/05 2017

0.1.0

0.1.0.0

Search query language for Laravel 5.4+ supporting Eloquent and Elasticsearch

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Naph