We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
There are cases when computing ranking between search results and the default order by ORDER BY rank DESC, id ASC is not required.
ORDER BY rank DESC, id ASC
Although the default ordering can be disabled with .reorder(nil) the ranking computation itself can't be disabled.
.reorder(nil)
I wish there was a an option for pg_search's ranked_by to disable it.
pg_search
ranked_by
Something like: rank: false or ranked_by: false
rank: false
ranked_by: false
If I'm not mistaken it should be possible by making this optional:
pg_search/lib/pg_search/scope_options.rb
Lines 138 to 142 in ea17b19
so that if config.ranking_sql (which is the value of options[:ranked_by]) is explicitly set to false ranking can be skipped entirely.
config.ranking_sql
options[:ranked_by]
false
I can try to transform this idea into a PR, let me know
The text was updated successfully, but these errors were encountered:
fwiw i could apply my own ordering by monkey-patching PgSearch::ScopeOptions#apply from line 21:
PgSearch::ScopeOptions#apply
https://github.com/Casecommons/pg_search/blob/master/lib/pg_search/scope_options.rb#L21-L23
module PgSearch ScopeOptions.class_eval do def apply(scope) scope = include_table_aliasing_for_rank(scope) rank_table_alias = scope.pg_search_rank_table_alias(include_counter: true) scope.joins(rank_join(rank_table_alias)) end end end
Sorry, something went wrong.
No branches or pull requests
There are cases when computing ranking between search results and the default order by
ORDER BY rank DESC, id ASC
is not required.Although the default ordering can be disabled with
.reorder(nil)
the ranking computation itself can't be disabled.I wish there was a an option for
pg_search
'sranked_by
to disable it.Something like:
rank: false
orranked_by: false
If I'm not mistaken it should be possible by making this optional:
pg_search/lib/pg_search/scope_options.rb
Lines 138 to 142 in ea17b19
so that if
config.ranking_sql
(which is the value ofoptions[:ranked_by]
) is explicitly set tofalse
ranking can be skipped entirely.I can try to transform this idea into a PR, let me know
The text was updated successfully, but these errors were encountered: