You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@physicians = Physician.where(nil)
filtering_params(params).each do |key, value|
@physicians = @physicians.public_send("filter_by_#{key}", value) if value.present?
end
@pagy, @physicians = pagy(@physicians, items: 10, link_extra: 'data-remote="true"')
I'm under the impression that since I'm now using the search document table, I can now simplify my scopes to only search within the search document table and I don't need to use joins anymore.
I've built my search document to include results from my association.
The issues I've ran into:
Leaving the search blank/empty, won't return all results and instead throws:
This does work by itself but I can't chain to further filter the results.
For example, if I filter by office_user and then territory, I end up getting this error:
I'm moving from using search scopes to multi-search because of performance issue when searching associations.
I have a search bar and and 3 optional filters to filter the results. The 3 filters are scopes that use joins for the association.
For example:
The search uses a scope as well:
Here is the physician controller search action:
I'm under the impression that since I'm now using the search document table, I can now simplify my scopes to only search within the search document table and I don't need to use joins anymore.
I've built my search document to include results from my association.
The issues I've ran into:
Leaving the search blank/empty, won't return all results and instead throws:
Changing my scopes to use PgSearch.multisearch
This does work by itself but I can't chain to further filter the results.
For example, if I filter by office_user and then territory, I end up getting this error:
I'd be grateful on any help figuring a better approach to filtering results.
The text was updated successfully, but these errors were encountered: