All Projects → globalia → laravel-scout-mysql

globalia / laravel-scout-mysql

Licence: other
A MySql Engine for Laravel Scout

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-scout-mysql

rql-scala
RethinkDB Scala Driver
Stars: ✭ 13 (-48%)
Mutual labels:  driver
generic-linked-in-driver
A generic non-blocking linked-in driver for interfacing Erlang and C
Stars: ✭ 46 (+84%)
Mutual labels:  driver
usb
Minimalist portable USB device stack for SAMD21, LPC1800, LPC4300, Xmega
Stars: ✭ 90 (+260%)
Mutual labels:  driver
OpenDriver2Tools
Driver 1 and Driver 2 tools
Stars: ✭ 25 (+0%)
Mutual labels:  driver
WindowsIoTEverywhere
Images & drivers to get WIndows 10 IoT running on off-the-shelf tablets, mini-pcs, and various computers.
Stars: ✭ 23 (-8%)
Mutual labels:  driver
windows-process-monitor
A demo solution to illustrate approaches on getting information about processes and block/allow their start
Stars: ✭ 89 (+256%)
Mutual labels:  driver
realtek rtwifi
Realtek RTWIFI - RTL8XXXU mod
Stars: ✭ 32 (+28%)
Mutual labels:  driver
tn40xx-driver
Linux driver for tn40xx from Tehuti Networks
Stars: ✭ 53 (+112%)
Mutual labels:  driver
mongodb-go-tutorial
Example using the MongoDB Go Driver
Stars: ✭ 114 (+356%)
Mutual labels:  driver
BioBalanceDetector
Bio Balance Detector's products aim to show the weak electromagnetic fields around every living being (including plants, animals and humans) and display it in a heat-map like hyper-spectral image.
Stars: ✭ 18 (-28%)
Mutual labels:  driver
rtl88x2BU WiFi linux v5.2.4.1 22719 COEX20170518-4444.20170613
rtl88x2bu driver updated for modern kernels.
Stars: ✭ 26 (+4%)
Mutual labels:  driver
wiasane
Scanner Access Now Easy - WIA Driver
Stars: ✭ 109 (+336%)
Mutual labels:  driver
h2go
Apache H2 Go SQL Driver
Stars: ✭ 35 (+40%)
Mutual labels:  driver
Driver.NET
Lightweight and flexible library to load and communicate with kernel drivers on Windows.
Stars: ✭ 59 (+136%)
Mutual labels:  driver
neo4j-php-client
Php client and driver for neo4j database
Stars: ✭ 95 (+280%)
Mutual labels:  driver
Meteor-logger
🧾 Meteor isomorphic logger. Store application logs in File (FS), MongoDB, or print in Console
Stars: ✭ 51 (+104%)
Mutual labels:  driver
abb robot driver
The new ROS driver for ABB robots
Stars: ✭ 55 (+120%)
Mutual labels:  driver
pwm-pca9685-rs
Platform-agnostic Rust driver for the PCA9685 I2C 16-channel, 12-bit PWM/Servo/LED controller
Stars: ✭ 19 (-24%)
Mutual labels:  driver
rogdrv
ASUS ROG userspace mouse driver for Linux
Stars: ✭ 41 (+64%)
Mutual labels:  driver
libx52
Saitek X52/X52pro drivers & controller mapping software for Linux
Stars: ✭ 85 (+240%)
Mutual labels:  driver

Laravel Scout MySQL Driver

This package is a MySQL driver for Laravel Scout.

Contents

Installation

You can install the package via composer:

composer config repositories.globalia/laravel-scout-mysql git https://github.com/globalia/laravel-scout-mysql.git

composer require "globalia/laravel-scout-mysql" "^1.0"

You must add the Scout service provider and the package service provider in your app.php config:

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

Setting up database search indexes table:

php artisan migrate

After you've published the Laravel Scout package configuration:

// config/scout.php
// Set your driver to mysql
    'driver' => env('SCOUT_DRIVER', 'mysql'),

Usage

Here is an example of how to use the engine:

    $result = Todo::search($term)
        ->where('boost(name)', 5)
        ->where('boost(tags)', 2)
        ->where('checked', 1)
        ->where('published_at >=', \Carbon::now());

    return null === $limit ? $result->get() : $result->paginate($limit);

Instead of using the "Laravel\Scout\Searchable" trait, use this "Globalia\LaravelScoutMysql\Models\Concerns\HasSearchIndex"

otherwise you can use Laravel Scout as described in the official documentation

Searching in all models

Since the index table is a model, you can search in it directly. Each result will be hydrated to its corresponding model.

    $result = SearchIndex::search($term);

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].