-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ignored queries options #2
Comments
I'm thinking there 2 separate concerns here. 1). DSL for declaring allowed parameters and their options, as a mixin that can be added to your own presenters, search classes or even controllers. 2). Abstraction for easier building of ElasticSearch queries. So from the point of view of the param-filtering DSL it shouldn't have to care what the params are used for. re. programatically adding ES filters like this, I'm not sure how useful it is. For example in an app of mine I sometimes use |
Hmmm, they seem distinct enough to deal with entirely separately. I did think adapters would be a good way to go if it made any sense, but I'm not sure if that would just be bloat. Our reason for programmatically declaring filters was that we had a hell of a lot of them (20 by my count, including the search field) that all behaved the same way. For us it was just a case of not wanting to repeat every parameter several times. Considering how the Tire gem works and without diving into its internals I'm not quite sure how to keep that DRY while offering some clarity :( |
Some parameters are used to determine pagination and don't have any effect on the filters or queries passed in, eg.
per_page
andpage
. We use logic like this on Amnesty to save some time:Should some things have their own methods (ie. stuff that deals with pagination), or should there be an option to exclude them as actual queries?
Would it be worth having either an
ignore
option forsearch_option
, or otherwiseThe text was updated successfully, but these errors were encountered: