All Projects → algolia → laravel-scout-settings

algolia / laravel-scout-settings

Licence: MIT license
DEPRECATED: Use of this repository is deprecated. Please use Scout Extended - https://github.com/algolia/scout-extended instead.

Programming Languages

PHP
23972 projects - #3 most used programming language

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

Algoliasearch Client Go
⚡️ A fully-featured and blazing-fast Go API client to interact with Algolia.
Stars: ✭ 147 (+539.13%)
Mutual labels:  algolia
Docsearch Scraper
DocSearch - Scraper
Stars: ✭ 188 (+717.39%)
Mutual labels:  algolia
Learn X By Doing Y
🛠️ Learn a technology X by doing a project - Search engine of project-based learning
Stars: ✭ 242 (+952.17%)
Mutual labels:  algolia
Combine Pagination
A JavaScript library for paginating data from multiple sources 🦑
Stars: ✭ 157 (+582.61%)
Mutual labels:  algolia
Dvc.org
🔗 DVC website and documentation
Stars: ✭ 171 (+643.48%)
Mutual labels:  algolia
What Hn Says Webext
Web Extension: Easily find Hacker News discussions about the page you're currently browsing.
Stars: ✭ 214 (+830.43%)
Mutual labels:  algolia
Docsearch
📘 The easiest way to add search to your documentation.
Stars: ✭ 2,266 (+9752.17%)
Mutual labels:  algolia
bulksearch
Lightweight and read-write optimized full text search library.
Stars: ✭ 108 (+369.57%)
Mutual labels:  search-in-text
Atom Autocomplete Module Import
⚛️ Search & install npm packages from import/require statements.
Stars: ✭ 182 (+691.3%)
Mutual labels:  algolia
Instantsearch.js
⚡️ A JavaScript library for building performant and instant search experiences with Algolia.
Stars: ✭ 2,799 (+12069.57%)
Mutual labels:  algolia
Algoliasearch Magento
Algolia Search integration for Magento 1 - compatible with versions from 1.6.x to 1.9.x
Stars: ✭ 163 (+608.7%)
Mutual labels:  algolia
Angular Search Experience
Algolia + Angular = 🔥🔥🔥
Stars: ✭ 167 (+626.09%)
Mutual labels:  algolia
Angular Instantsearch
⚡️Lightning-fast search for Angular apps, by Algolia
Stars: ✭ 219 (+852.17%)
Mutual labels:  algolia
Gatsby Plugin Algolia
A plugin to push to Algolia based on graphQl queries
Stars: ✭ 154 (+569.57%)
Mutual labels:  algolia
elasticscout
ElasticScout is an optimized Laravel Scout driver for Elasticsearch 7.1+
Stars: ✭ 64 (+178.26%)
Mutual labels:  laravel-scout
Algoliasearch Helper Js
Helper for implementing advanced search features with Algolia
Stars: ✭ 147 (+539.13%)
Mutual labels:  algolia
Algoliasearch Netlify
Official Algolia Plugin for Netlify. Index your website to Algolia when deploying your project to Netlify with the Algolia Crawler
Stars: ✭ 208 (+804.35%)
Mutual labels:  algolia
sliceslice-rs
A fast implementation of single-pattern substring search using SIMD acceleration.
Stars: ✭ 66 (+186.96%)
Mutual labels:  search-in-text
atomic-algolia
An NPM package for running atomic updates to an Algolia indices
Stars: ✭ 65 (+182.61%)
Mutual labels:  algolia
Docs
Repository of Twilio SendGrid's product documentation.
Stars: ✭ 221 (+860.87%)
Mutual labels:  algolia

DEPRECATED: Use of this repository is deprecated. Please use Scout Extended - https://github.com/algolia/scout-extended instead.

Laravel Scout Settings

Import/Export Algolia settings, synonyms and query rules into your Laravel Scout project.

The easiest way to manage your settings is usually to go to your Algolia dashboard because it has a nice UI and you can test the relevancy directly there.

Once you fine tuned your configuration, you may want to add it to your project.

This package adds two Laravel commands to your project:

  • one to save your settings, synonyms and query rules into JSON files
  • one to push everything back to Algolia

This has 3 major advantages:

  1. You can version your configuration with your VCS
  2. You can set up a new environment or restore backups easily
  3. It lets you customize your settings in JSON format before pushing them

Install

Install this package with composer

composer require algolia/laravel-scout-settings

Laravel 5.5

If you use Laravel 5.5, this package will take advantage of the Package Auto-Discovery feature. Nothing more to do to register the commands.

Laravel 5.4 and prior

If you use an older version of Laravel, you will have to add the Service Provider to the providers array in config/app.php

Algolia\Settings\ServiceProvider::class,

Usage

You will now get two new commands available in artisan. They both take a model's fully qualified class name, just like Laravel Scout does to import/flush data.

The following example assume you have an App\Contact class, which uses the Searchable trait.

Note: Scout allows you to customize the index name with the searchableAs() method. This package will follow this naming convention.

Backing up settings (Project ⬅️ Algolia)

The following command will export all the settings and synonyms from the App\Contact's index into the following files:

  • Settings: resources/algolia-settings/index_name.json
  • Synonyms: resources/algolia-settings/index_name-synonyms.json
  • Query Rules: resources/algolia-settings/index_name-rules
php artisan algolia:settings:backup "App\Contact"

Note that if you want to add the prefix to your file names (which was the default behavior in v1), you can pass the --prefix option.

php artisan algolia:settings:backup "App\Contact" --prefix

Pushing settings (Project ➡️ Algolia)

The following command will read all the settings, synonyms and query rules from the files in resources/algolia-settings/ and import them into Algolia's index.

php artisan algolia:settings:push "App\Contact"

You can also pass the --prefix option, just like the backup command.

Customizing directory

By default, settings, rules and synonyms are saved into the resources/algolia-settings. The directory can be customized by the defining an environment variable named ALGOLIA_SETTINGS_FOLDER. For example, the following command will save all the index resources into resources/indexmeta.

ALGOLIA_SETTINGS_FOLDER=indexmeta php artisan algolia:settings:backup

Testing

composer test

Need help?

Feel free to open a thread on our Community forum

Contribute

Contributions are welcome!

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