-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
What filters do you use? #63
Comments
Not exactly a filter but I currently have the need to do a %LIKE% search word by word (I'm overriding the current behaviour to do this) but this would be a great feature IMO, since the search is used to lookup on several properties. Could have some options, such as "strict" like where it would search "%something like this%" or a "loose" one where it would search "%something%" "%like%" "%this%" Just a thought! Package looks good as it is |
Thats a very interesting idea - the only thing I wonder: is this still filtering? or is it searching? I think filtering should be fast and performant, able to work with indexes... I could imagine some extensions:
Finally what could also be an improvement: currently the search is running against all searchable fields... maybe it could be possible to set the fields with the scope - something like: yeah, title, description and name are searchable, but this time I only want to search in title... and even more: i want to search in title for x and in description for y - x shall be in like-mode, y in fulltext-search mode... This is kind of filtering, but naming is better, since it really searches... would this solve your usecase? I already have an own usecase for it... currently in my software I only offer one single search-field... it could be possible to add a input-search-field to each column of the table... with that solution... |
I think it's more of a searching than filtering, you're right. In my head it's hard to make that distinction sometimes. I think the use cases that you wrote explain it better than I ever would! I like the idea, specially the limitation ofsearching through some of searchable fields. It would fit my use case for sure! I don't often use packages but I was setting up a pet project with your package and recently found the need to evolve it into something a little bigger ehehe. I've got a shitty availability outside working hours but If you want I can maybe open a PR with a draft of it whenever I have the time |
What about the model relation filter? does this package support it? i want to use it but not sure about it. |
@Akhmami it depends on the relation - since v2 I integrated a belongsTo and belongsToMany Filter that makes it more convenient to work with Standard-Situations, where you have a relation with e.G. a title-Column, that shall be shown in a select-input - see more here: Is this what you need? |
@mrABR I just introduced v3 of the package that will introduce new Search-Modes that exactly fit your idea
For your need you can use the Contains modes - either any or all depending on your needs. I had to introduce a v3 due to breaking changes. See upgrade-docs for more information: For most people it will be a drop-in-replacement, but if anybody has overwritten the filters() or searchable() methods on the traits, it will break now... and additionally the search-case-sensitivity might have changed, because until v2 it depended on the used database-engine (Postgres was always sensitive, mysql almost not, ans sqlite never). |
Hi everybody
I'd like to collect some ideas about new filters. It would be very interesting how you all use the filters and what individual filters you create, and if it makes sense to add them as new Filter types or even as a default filter...
Waiting for your feedback.
The text was updated successfully, but these errors were encountered: