1- ** Unfortunately I do not have much time to give this package the attention it needs.
2- If you are interested in taking over this package please contact me at damian@troyweb.com **
3-
41Laravel Scout MySQL Driver
52==========================
63
7- Search Eloquent Models using MySQL ` FULLTEXT ` Indexes or ` WHERE LIKE '%:search% ` ' statements.
4+ Search Eloquent Models using MySQL ` FULLTEXT ` Indexes or ` WHERE LIKE '%:search% ` ' statements.
85
961 . [ Installation] ( #installation )
1072 . [ Usage] ( #usage )
@@ -18,12 +15,12 @@ Installation <div id="installation"></div>
1815
1916** Note: Any Models you plan to search using this driver must use a MySQL MyISAM or InnoDB table.**
2017
21- If you haven't already you should [ install Laravel Scout] ( https://laravel.com/docs/5.3/scout#installation ) to
18+ If you haven't already you should [ install Laravel Scout] ( https://laravel.com/docs/5.3/scout#installation ) to
2219your project and apply the ` Laravel\Scout\Searchable ` trait to any Eloquent models you would like to make searchable.
2320
2421Install this package via ** Composer**
25-
26- ` composer require damiantw /laravel-scout-mysql-driver `
22+
23+ ` composer require yab /laravel-scout-mysql-driver `
2724
2825
2926Next add the ServiceProvider to the Package Service Providers in ` config/app.php `
@@ -32,7 +29,7 @@ Next add the ServiceProvider to the Package Service Providers in `config/app.php
3229 /*
3330 * Package Service Providers...
3431 */
35- DamianTW \MySQLScout\Providers\MySQLScoutServiceProvider::class,
32+ Yab \MySQLScout\Providers\MySQLScoutServiceProvider::class,
3633```
3734
3835Append the default configuration to ` config/scout.php `
@@ -81,16 +78,16 @@ Simply call the `search()` method on your `Searchable` models:
8178
8279` $beers = App\Drink::search('beer')->get(); `
8380
84- Or With pagination:
81+ Or With pagination:
8582
8683` $beers = App\Drink::search('beer')->paginate(15); `
8784
88- Simple constraints can be applied using the ` where() ` builder method
85+ Simple constraints can be applied using the ` where() ` builder method
8986(each additional ` WHERE ` will be applied using ` AND ` ).
9087
9188` $beers = App\Drink::search('beer')->where('in_stock', 1)->get(); `
9289
93- The following operators can be applied to the ` WHERE ` statements: ` <> != = <= < >= > `
90+ The following operators can be applied to the ` WHERE ` statements: ` <> != = <= < >= > `
9491(` = ` will be used if no operator is specified)
9592
9693` $beers = App\Drink::search('beer')->where('abv >', 10)->get(); `
@@ -100,13 +97,13 @@ For more usage information see the [Laravel Scout Documentation](https://laravel
10097Modes <div id =" modes " ></div >
10198-----
10299
103- This driver can perform different types of search queries depending on the mode set in the ` scout.mysql.mode `
100+ This driver can perform different types of search queries depending on the mode set in the ` scout.mysql.mode `
104101Laravel configuration value. Currently 4 different modes are supported ` NATURAL_LANGUAGE ` ,` BOOLEAN ` ,` LIKE ` and ` LIKE_EXPANDED ` .
105102
106103
107104### NATURAL_LANGUAGE and BOOLEAN Modes
108105
109- In ` NATURAL_LANGUAGE ` and ` BOOLEAN ` mode the driver will run MySQL ` WHERE MATCH() AGAINST() ` queries in the
106+ In ` NATURAL_LANGUAGE ` and ` BOOLEAN ` mode the driver will run MySQL ` WHERE MATCH() AGAINST() ` queries in the
110107respective modes.
111108
112109Both modes search queries will include all of Model's ` FULLTEXT ` compatible fields (` CHAR ` ,` VARCHAR ` ,` TEXT ` )
@@ -138,12 +135,12 @@ select * from `posts` where MATCH(content,meta) AGAINST(? IN BOOLEAN MODE)
138135Operators for ` BOOLEAN ` mode should be passed as part of the search string.
139136
140137
141- For more information see the
138+ For more information see the
142139[ MySQL's Full-Text Search Functions documentation] ( http://dev.mysql.com/doc/refman/5.7/en/fulltext-search.html ) .
143140
144141### LIKE and LIKE_EXPANDED Modes
145142
146- ` LIKE ` and ` LIKE_EXPANDED ` modes will run ` WHERE LIKE %?% ` queries that will include all of the Model's fields
143+ ` LIKE ` and ` LIKE_EXPANDED ` modes will run ` WHERE LIKE %?% ` queries that will include all of the Model's fields
147144returned from ` toSearchableArray() ` . ` LIKE_EXPANDED ` mode will query each field using each individual word in the search string.
148145
149146For example running a search on a ` Customer ` model with the following database structure:
@@ -169,23 +166,23 @@ SELECT * FROM `customers` WHERE (`id` LIKE '%John%' OR `id` LIKE '%Smith%' OR `f
169166Console Command <div id =" console-command " ></div >
170167---------------
171168
172- The command ` php artisan scout:mysql-index {model?} ` is included to manage the ` FULLTEXT ` indexes needed for
173- ` NATURAL_LANGUAGE ` and ` BOOLEAN ` modes.
169+ The command ` php artisan scout:mysql-index {model?} ` is included to manage the ` FULLTEXT ` indexes needed for
170+ ` NATURAL_LANGUAGE ` and ` BOOLEAN ` modes.
174171
175172If the model parameter is omitted the command will run with all Model's with the ` Laravel\Scout\Searchable ` trait
176173and a MySQL connection within the directories defined in the ` scout.mysql.model_directories ` Laravel configuration value.
177174
178175### Creating Indexes
179176
180- Pass the command a Model to create a ` FULLTEXT ` index for all of the Model's ` FULLTEXT ` compatible fields
177+ Pass the command a Model to create a ` FULLTEXT ` index for all of the Model's ` FULLTEXT ` compatible fields
181178(` CHAR ` ,` VARCHAR ` ,` TEXT ` ) returned from the Model's ` toSearchableArray() ` method. The index name will be the result of
182- the Model's ` searchableAs() ` method.
179+ the Model's ` searchableAs() ` method.
183180
184181If an index already exists for the Model and the Model contains new searchable fields not in the existing index the
185182index will be dropped and recreated.
186183
187184` php artisan scout:mysql-index App\\Post `
188-
185+
189186### Dropping index
190187
191188Pass the ` -D ` or ` --drop ` options to drop an existing index for a Model.
@@ -201,21 +198,21 @@ Behavior can be changed by modifying the `scout.mysql` Laravel configuration val
201198` NATURAL_LANGUAGE ` ,` BOOLEAN ` ,` LIKE ` and ` LIKE_EXPANDED ` .
202199
203200* ` scout.mysql.model_directories ` - If no model parameter is provided to the included ` php artisian scout:mysql-index `
204- command the directories defined here will be searched for Model's with the ` Laravel\Scout\Searchable ` trait
201+ command the directories defined here will be searched for Model's with the ` Laravel\Scout\Searchable ` trait
205202and a MySQL connection.
206203
207- * ` scout.mysql.min_search_length ` - If the length of a search string is smaller then this value no search queries will
204+ * ` scout.mysql.min_search_length ` - If the length of a search string is smaller then this value no search queries will
208205run and an empty Collection will be returned.
209206
210- * ` scout.mysql.min_fulltext_search_length ` - If using ` NATURAL_LANGUAGE ` or ` BOOLEAN ` modes and a search string's length
211- is less than this value the driver will revert to a fallback mode. By default MySQL requires a search string length of at
212- least 4 to to run ` FULLTEXT ` queries. For information on changing this see the
207+ * ` scout.mysql.min_fulltext_search_length ` - If using ` NATURAL_LANGUAGE ` or ` BOOLEAN ` modes and a search string's length
208+ is less than this value the driver will revert to a fallback mode. By default MySQL requires a search string length of at
209+ least 4 to to run ` FULLTEXT ` queries. For information on changing this see the
213210[ MySQL's Fine-Tuning MySQL Full-Text Search documentation] ( http://dev.mysql.com/doc/refman/5.7/en/fulltext-fine-tuning.html ) .
214211
215- * ` scout.mysql.min_fulltext_search_fallback ` - The mode that will be used as a fallback when the search string's length
212+ * ` scout.mysql.min_fulltext_search_fallback ` - The mode that will be used as a fallback when the search string's length
216213is less than ` scout.mysql.min_fulltext_search_length ` in ` NATURAL_LANGUAGE ` or ` BOOLEAN ` modes. Acceptable values are
217214` LIKE ` and ` LIKE_EXPANDED ` .
218215
219216* ` scout.mysql.query_expansion ` - If set to true MySQL query expansion will be used in search queries. Only applies if
220- using ` NATURAL_LANGUAGE ` mode. For more information see
221- [ MySQL's Full-Text Searches with Query Expansion documentation] ( http://dev.mysql.com/doc/refman/5.7/en/fulltext-query-expansion.html ) .
217+ using ` NATURAL_LANGUAGE ` mode. For more information see
218+ [ MySQL's Full-Text Searches with Query Expansion documentation] ( http://dev.mysql.com/doc/refman/5.7/en/fulltext-query-expansion.html ) .
0 commit comments