Sti3bas / laravel-scout-array-driver

Array driver for Laravel Scout
MIT License
89 stars 8 forks source link

Does this driver work same as the collection one #11

Closed Stevemoretz closed 1 year ago

Stevemoretz commented 2 years ago

I noticed collection driver was added in Laravel 9, https://laravel.com/docs/9.x/scout#collection-engine.

Differences From Database Engine On first glance, the "database" and "collections" engines are fairly similar. They both interact directly with your database to retrieve search results. However, the collection engine does not utilize full text indexes or LIKE clauses to find matching records. Instead, it pulls all possible records and uses Laravel's Str::is helper to determine if the search string exists within the model attribute values.

The collection engine is the most portable search engine as it works across all relational databases supported by Laravel (including SQLite and SQL Server); however, it is less efficient than Scout's database engine.

Does this work the same way? or does it work in a different way?

Just one more question are where clauses supported here too? https://laravel.com/docs/9.x/scout#where-clauses

Sti3bas commented 1 year ago

Does this work the same way? or does it work in a different way?

Collection driver is designed to be used in production, but Array driver is exclusively dedicated to automated testing, it does not persist any data.

Just one more question are where clauses supported here too? https://laravel.com/docs/9.x/scout#where-clauses

Yes, where clauses should be supported.

Stevemoretz commented 1 year ago

Thanks great library!

chrisrhymes commented 9 months ago

Just wondering if whereIn clauses are supported too?