Comments (2)
Also interested to know if there's any clean workaround.
from laravel-scout-typesense-driver.
Also have this requirement so have been digging into the libraries a bit to see if there's a lower level undocumented workaround without falling back to this driver.
If we look at the Laravel Scout core typesense engine we can see that it proxies methods dynamically onto the underlying client:
https://github.com/laravel/scout/blob/8af517e61e88c423b9e9b466713e5f3a56e588ac/src/Engines/TypesenseEngine.php#L534
This means we can get hold of the client multisearch by doing this:
$multiSearch = app(Laravel\Scout\EngineManager::class)->engine('typesense')->getMultiSearch();
We can then call perform
on this and pass in our query similarly to https://github.com/typesense/laravel-scout-typesense-driver?tab=readme-ov-file#multi-search - syntax slightly different e.g. $multiSearch->perform(['searches' => $searchRequests, $options]);
See https://github.com/typesense/typesense-php/blob/4e41737b4ee416e6b2041f81f5506bdac7c823b2/src/MultiSearch.php#L39 for the signature and how it's implemented in the client.
Bear in mind as this is lower level you won't get a lot of the magic, e.g. youll be getting a simple array back rather than a builder instance, so you won't have paginateRaw
without implementing it yourself, if you're using SCOUT_PREFIX
you would need to add that to your collection names manually, etc
(Edits for clarity)
from laravel-scout-typesense-driver.
Related Issues (20)
- Laravel 10 Support HOT 10
- Error from Typesense on Update of Model Instance which is not in index HOT 2
- PHP 8.2 deprecation warnings HOT 1
- Laravel Scout 10? HOT 1
- Unable to sort HOT 4
- Error importing document: Field `itemStocks` not found. HOT 2
- "Undefined property: Laravel\\Scout\\Builder::$whereIns", HOT 1
- Filter in typesensne collection of objects in Laravel
- $model->unsearchable(); does not work HOT 7
- Import not working with array data. HOT 11
- Model update resets document auto-generated embeddings HOT 1
- Cannot index collection with a soft deleted first model when scout.soft_delete is true HOT 2
- Hotfix TypeError - Typesense\\Documents::import(): Argument #1 ($documents) must be of type string, array given. HOT 5
- Undefined property: Laravel\Scout\Builder::$whereIns HOT 1
- Passing "empty" values to search query results in "Parameter `q` is required"
- Please add possibility to use Laravel Scout Builder ->options() method
- Duplicate array keys in TypesenseEngine::buildSearchParams HOT 1
- Exception when searching large datasets for common query HOT 2
- Typesense scout import fails in Laravel 11 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-scout-typesense-driver.