-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scout integration #32
Comments
Thanks, @lindyhopchris. I didn't realize this package had moved. I spent some time playing around with this yesterday but didn't get very far -- as you say it is a bit complicated. In other frameworks (or one, at least) I have seen the search index implemented as a separate endpoint for the searchable resources. I tried to do something like that with a custom adapter as well but it got a bit murky in part because the index would be effectively read only. The Nova approach (just modifying behavior based on the |
Well this new version is still in It's easier to ship custom index actions in this new version, the docs actually cover that already: I've never used Scout so I'm going to have to get my head wrapped round it a bit to work out how best to actually integrate it. Off the top-of my head, it might be as easy as attaching Scout filters, so the integration knows if the client has used a Scout filter then it needs to use a Scout builder when querying the database. The filter implemetnation in the new package is described here: Would be good to hear your thoughts! |
Any updates on this one? Would love to have it integrated. |
This isn't top of my priorities tbh, because I've never used Scout and don't have a project where I would use it any time soon. If there's someone who has Scout experience and would like to contribute, then I'd be happy to work with them on getting support in. |
@lindyhopchris i tried your suggestion above and did not work, i guess it is because Scout uses another query builder. Creating a filter and then using it totally ignores the query. Referring to I can always override FetchMany, but i would lose the other filters and scopes i have already defined on the UserSchema. If i come up with a clean-enough solution for now i'll post it here. Thanks for getting back to me anyway :) |
hello @ionut-tanasa , have you managed to find any solution? I am running into the same issue and trying to find a clean solution for this! Thank you |
Hello everyone, is there any solution for this, or? Thanks. |
This is really tricky because it uses a different query builder, and we need the "normal" query builder to sort out things like eager loading (JSON:API include paths). I feel like it's going to need some significant refactoring to sort out. It needs someone to work out how in theory it should be implemented, as I don't have any Scout experience myself. What needs to be worked out is how a developer would (outside of JSON:API) handle querying via Scout when you then need to apply eager loading, pagination, filters and only returning specific columns (sparse field-sets). I.e. if you were doing that on a standard controller (not a JSON:API one), how would you go about implementing it? What would your code look like? How would you test it? If someone can come up with an approach that would work and can provide code examples, then I can do the bit of figuring how to incorporate that into Laravel JSON:API. Because I would love to support this in Laravel JSON:API, but I need someone with Scout experience to provide the code examples of how querying with all those other query parameters that a client can provide should actually work. |
Need to work out how to integrate Scout into index queries (and to-many relationship queries). This has been requested in the previous package here:
cloudcreativity/laravel-json-api#449
And the solution should probably take into account how Nova do it (although it's a lot more complicated in our scenario because it's not just tied to an input box that searches a specific resource, it's tied to a client's index query that could contain standard filters).
Nova solution here:
https://nova.laravel.com/docs/3.0/search/scout-integration.html
The text was updated successfully, but these errors were encountered: