[GENERAL] ts_rank and ts_rank_cd with multiple search terms

2015-07-25 Thread Robert Nikander
Hi, I’m reading about the ranking functions [1], and I have a couple questions… 1. Is ts_rank taking proximity of terms into account? It seems like it is, but the docs suggest that only ts_rank_cd does that. 2. Is there a way to search multiple terms like ‘a | b | c …’ but score higher when

[GENERAL] use null or 0 in foreign key column, to mean no value?

2015-06-26 Thread Robert Nikander
Hi, (Maybe my subject line should be: `is not distinct from` and indexes.) In Postgres 9.4, I’ve got a table of ‘items’ that references a table ‘colors’. Not all items have colors, so I created a nullable column in items like: color_id bigint references colors There is also an index