All Projects → gtkvn → larasearch

gtkvn / larasearch

Licence: MIT License
A driver based solution to searching your Eloquent models supports Laravel 5.2 and Elasticsearch engine.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to larasearch

search-for-kirby
Kirby 3 plugin for adding a search index (sqlite or Algolia).
Stars: ✭ 42 (+223.08%)
Mutual labels:  algolia, full-text-search
musicologist
Music advice from a conversational interface powered by Algolia
Stars: ✭ 19 (+46.15%)
Mutual labels:  algolia
gatsby-plugin-lunr
Gatsby plugin for full text search implementation based on lunr client-side index. Supports multilanguage search.
Stars: ✭ 69 (+430.77%)
Mutual labels:  full-text-search
twitter
A serverless social network that's under development with some cool stuff, such as Serverless Framework, AppSync, GraphQL, Lambda, DynamoDB, Cognito, Kinesis Firehose, and Algolia ☁️
Stars: ✭ 29 (+123.08%)
Mutual labels:  algolia
buke
full text search manpages
Stars: ✭ 27 (+107.69%)
Mutual labels:  full-text-search
cang-jie
Chinese tokenizer for tantivy, based on jieba-rs
Stars: ✭ 48 (+269.23%)
Mutual labels:  full-text-search
poyonga
Python Groonga Client
Stars: ✭ 19 (+46.15%)
Mutual labels:  full-text-search
svelte-algolia
Svelte plugin for keeping Algolia indices in sync with custom data fetching functions.
Stars: ✭ 17 (+30.77%)
Mutual labels:  algolia
ex elasticlunr
Elasticlunr is a small, full-text search library for use in the Elixir environment. It indexes JSON documents and provides a friendly search interface to retrieve documents.
Stars: ✭ 125 (+861.54%)
Mutual labels:  full-text-search
contentful-to-algolia
⚡️ Transmit content from any Contentful type to Algolia indexes
Stars: ✭ 50 (+284.62%)
Mutual labels:  algolia
gatsby-simple-blog
an easily configurable gatsby-starter-blog with overreacted looking and tags, breadcrumbs, disqus, i18n, eslint, algolia supported
Stars: ✭ 48 (+269.23%)
Mutual labels:  algolia
react-firebase-socialnetwork
Social network-like for finding groups online
Stars: ✭ 28 (+115.38%)
Mutual labels:  algolia
create-instantsearch-app
⚡️ Build InstantSearch apps at the speed of thought
Stars: ✭ 92 (+607.69%)
Mutual labels:  algolia
nicolas-hoizey.com
The personal website/blog from Nicolas Hoizey, built with https://pack11ty.dev/
Stars: ✭ 77 (+492.31%)
Mutual labels:  algolia
rgpipe
lesspipe for ripgrep for common new filetypes using few dependencies
Stars: ✭ 21 (+61.54%)
Mutual labels:  full-text-search
guillaumebriday.fr
✏️ 📖 My personal blog built with Gatsby and Tailwind CSS.
Stars: ✭ 27 (+107.69%)
Mutual labels:  algolia
ulauncher-docsearch
Ulauncher extension for doing full text search on Documentation sites, powered by Algolia.
Stars: ✭ 20 (+53.85%)
Mutual labels:  algolia
instantsearch-android-examples
Example apps built with algolia/instantsearch-android
Stars: ✭ 60 (+361.54%)
Mutual labels:  algolia
rowy
Open-source Airtable-like experience for your database (Firestore) with GCP's scalability. Build any automation or cloud functions for your product. ⚡️✨
Stars: ✭ 2,676 (+20484.62%)
Mutual labels:  algolia
lucilla
Fast, efficient, in-memory Full Text Search for Kotlin
Stars: ✭ 102 (+684.62%)
Mutual labels:  full-text-search

Larasearch

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Introduction

This package is forked from Laravel Scout.

Larasearch based on the official Laravel Scout which provides a simple, driver based solution for adding full-text search to your Eloquent models to supports Laravel 5.2 and Elasticsearch Engine.

Installation

First, install the Larasearch via the Composer package manager:

composer require gtk/larasearch

Next, you should add the LarasearchServiceProvider to the providers array of your config/app.php configuration file:

Gtk\Larasearch\LarasearchServiceProvider::class,

After registering the Larasearch service provider, you should publish the Larasearch configuration using the vendor:publish Artisan command. This command will publish the larasearch.php configuration file to your config directory:

php artisan vendor:publish

Finally, add the Gtk\Larasearch\Searchable trait to the model you would like to make searchable. This trait will register a model observer to keep the model in sync with your search driver:

<?php

namespace App;

use Gtk\Larasearch\Searchable;
use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    use Searchable;
}

Searching with Elastic

When using the Elastic driver, you should configure your Elastic index and hosts credentials in your config/larasearch.php configuration file. Once your credentials have been configured, you will also need to install the Elastic PHP SDK via the Composer package manager:

composer require elasticsearch/elasticsearch

You may begin searching a model using the search method. The search method accepts a single string that will be used to search your models. You should then chain the get method onto the search query to retrieve the Eloquent models that match the given search query:

$orders = App\Order::search('Star Trek')->get();

Since Larasearch searches return a collection of Eloquent models, you may even return the results directly from a route or controller and they will automatically be converted to JSON:

use Illuminate\Http\Request;

Route::get('/search', function (Request $request) {
    return App\Order::search($request->search)->get();
});

The search method also accepts an array that will be used to perform an advanced search. Check Elastic document for more information.

$orders = App\Order::search(['query' => ['match' => ['title' => 'Star Trek']]])->get();

License

Larasearch is open-sourced software licensed under the MIT license.

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].