-
Notifications
You must be signed in to change notification settings - Fork 824
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
Smarter search for gridfield Proof-of-Concept #9836
Smarter search for gridfield Proof-of-Concept #9836
Conversation
Some of the follow up points worth looking into:
|
This is a must have ! Currently, the search experience is just really bad as customers expect that typing something in a large search bar would, at least, search in all visible columns. I don't know if it's really necessary to search for all possibles combinations (leading to potentially slow queries or too many matches).. or maybe make that a configurable option rather than a fixed default. |
This combination of hidden field + new filter does provide a nice experience. It does plug in well with the existing php classes + frontend The raw SQL it generates when searching for "lorem ipsum" will look like this
Which is quite different to passing in an array of values to the existing SearchContext, which does not produce a nice set of results
My main feedback here is that the the use of a SearchFilter on where you define multiple fields via $fieldList is pretty odd and breaks from all the other SearchFilters that work on a single field I'm just wondering if there's a way to write this SQL without the use of a SearchFilter that queries multiple columns? Maybe the logic can be moved somewhere else? |
What ever happened to this feature ? is there currently a work around ? |
you can use mine of you want the class is here the idea is to override the default search context in the GridFieldFilterHeader it's not so easy to do, because there is no way to set the searchContext, so I had to use reflection to do so. then, the idea is simply if there is only one search argument to do a filterAny for all availables filters. as an added bonus, i deal with multiple words as multiple AND/OR groups. sample usage in model admin
|
Closed in favor of #10382 |
Issue: #9356
This is a proof-of-concept to improve the default search set up for GridField.
NOT READY FOR PEER REVIEW.
The current Gridfield primary search has the default shortcomings:
This Proof-of-Concept improves on this by
This works mostly out of the box and could reasonably be shipped in 4.8 without requiring DEV to change anything.
This video illustrates the problem and then switch to this PR to illustrate how it works: https://www.youtube.com/watch?v=Z6SuDeMCrdI