Download the PHP package omure/scout-advanced-meilisearch without Composer
On this page you can find all versions of the php package omure/scout-advanced-meilisearch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download omure/scout-advanced-meilisearch
More information about omure/scout-advanced-meilisearch
Files in omure/scout-advanced-meilisearch
Package scout-advanced-meilisearch
Short Description Laravel Scout extension that allows to use meilisearch advanced features as well as has an extended collection driver for testing purposes.
License MIT
Informations about the package scout-advanced-meilisearch
Scout Advanced Meilisearch
What this package provides
Extended scout query builder
Added next changes to the basic query builder: 1) - extended where, which supports 3 optional parameters for comparison. Two parameters are also allowed. 2) - where can take a closure as the first parameter in order to group queries (the same for ) 3) 4) 5) All where clauses have or variant: , , etc
Two scout drivers
The drivers are compatible with the new scout builder.
- meilisearch_advanced
- collection_advanced
meilisearch_advanced
Uses all the advantages of meilisearch for comparison the results, searching in indexed arrays. Also fixes an issue with the calculation of the total number of values. (The current implementation requests the entire dataset in case scout builder has method used)
collection_advanced
The driver imitates how meilisearch work and completely relies on collections. It should be used only for tests as the whole searchable models data is in memory. The driver allows testing filtering and sorting as well as Extended scout builder features.
Meilisearch specific are taken into account
Meilisearch requires updating indexes filterable, sortable and searchable attributes in order to save the indexing data properly. This package provides facade that has method that handles that automatically.
How to use?
1) In set to or 2) Apply Searchable trait to the model (); 3) For proper handling of the model, implement interface to the model 4) Describe indexed parameters for searching in method of the model (the same way as Scout does) 5) Specify searchable, filterable and sortable attributes by defining the next list of methods on the model:
-
- for using statements
-
- for using , including , , etc. statements
-
- for using statement
-
- for typo tolerance All methods should return an array of strings which are the names of the parameters specified in .
If you change the methods , , or returned indexes, you have to let meilisearch know about the changes. For that purpose use the facade:
The method takes a model instance to update the parameters on the meilisearch server.
Keep in mind that doesn't have to have the same indexes as the database column names. You can specify your own logic for searching and filtering. Use the specified parameters in your Scout Builder.
All versions of scout-advanced-meilisearch with dependencies
laravel/framework Version ^9.0
laravel/scout Version ^9.4
meilisearch/meilisearch-php Version ^0.26