Skip to content

Commit

Permalink
🎉 Release v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
julienbourdeau committed Oct 19, 2017
1 parent 9790eb7 commit 19d56b1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

# v1.0.0

* Initial release
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Laravel Scout Settings

Import/Export Algolia settings into your Laravel Scout project.
**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 into a JSON file
- one to push them back to Algolia
- one to save your settings, synonyms and query rules into JSON files
- one to push everything back to Algolia

This has 3 majors advantages:

1. You can version your configuration with your VCS
2. You can set up a new environement or restore backups easily
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
Expand Down Expand Up @@ -44,19 +44,23 @@ You will now get two new commands available in `artisan`. They both take a model

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()`](https://laravel.com/docs/5.4/scout#configuring-model-indexes) method. This package will follow this naming convention.
Note: Scout allows you to customize the index name with the [`searchableAs()`](https://laravel.com/docs/scout#configuring-model-indexes) 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 `resources/algolia-settings/prefix_index_name.json` and `resources/algolia-settings/prefix_index_name-synonyms.json` files.
The following command will export all the settings and synonyms from the `App\Contact`'s index into the following files:

* **Settings**: `resources/algolia-settings/prefix_index_name.json`
* **Synonyms**: `resources/algolia-settings/prefix_index_name-synonyms.json`
* **Query Rules**: `resources/algolia-settings/prefix_index_name-rules`

```
php artisan algolia:settings:backup "App\Contact"
```

### Pushing settings (Project ➡️ Algolia)

The following command will read all the settings and synonyms from the `resources/algolia-settings/prefix_index_name.json` and `resources/algolia-settings/prefix_index_name-synonyms.json` files. and import them into Algolia's index.
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"
Expand All @@ -66,3 +70,7 @@ php artisan algolia:settings:push "App\Contact"
## Need help?

Feel free to open a thread on our [Community forum](https://discourse.algolia.com/)

### Contribute

Contributions are welcome!
2 changes: 1 addition & 1 deletion src/Console/AlgoliaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct()

protected function getIndex($indexName)
{
AlgoliaUserAgent::addSuffixUserAgentSegment('; Laravel Scout settings package', '0.x');
AlgoliaUserAgent::addSuffixUserAgentSegment('; Laravel Scout settings package', '1.0.0');

return (new Client(
config('scout.algolia.id'),
Expand Down

0 comments on commit 19d56b1

Please sign in to comment.