Cutoff ranking #23

elfassy opened this Issue Jan 13, 2012 · 6 comments


3 participants

elfassy commented Jan 13, 2012

Anyway to specify the minimum pg_search_rank that should be returned?



nertzy commented Jan 17, 2012

The easiest way would be to chain on a call to where.

MyClass.my_search_scope("query").where("pg_search_rank > 0.2")

Other than that I will research good ways to expose the built-in PostgreSQL way of filtering this, which should be more performant.


nertzy commented Feb 7, 2012

@elfassy I just wanted to check up, did my solution above work for you?

elfassy commented Feb 7, 2012

i might be missing something but that command always returns

PGError: ERROR:  column "pg_search_rank" does not exist

nertzy commented Feb 10, 2012

Ah ok, I was hoping that you could use a calculated column alias in a WHERE clause, but clearly you cannot. I will look into this further...

dfl commented Jun 21, 2012

+1 for this feature
For the time being I can filter on the front-end as the column is available on the model


nertzy commented Feb 23, 2015

A recent (still unpublished) change on master makes this possible. eb730f7

You can now add where("pg_search.rank > 0.2") and it should work.

nertzy closed this Feb 23, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment