How to use document age as weigt in ts_rank
I don't even get how this code is supposed to work

You have

(EXTRACT(epoch FROM (SELECT (NOW() - INTERVAL '10 days')))/3600)::int


All that's doing is resolving to a static int. How is dividing a result set by a static int significant.

SELECT ts_rank(to_tsvector('example of document'), to_tsquery('document'))
  / 420953;