Skip to content

Commit

Permalink
mod_search: use publication_start as a sub sort for matching, prefer …
Browse files Browse the repository at this point in the history
…newer content.
  • Loading branch information
mworrell committed Jan 10, 2017
1 parent 166791e commit 94054b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/mod_search/mod_search.erl
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ search({match_objects, [{id,Id}]}, _OffsetLimit, Context) ->
select="r.id, ts_rank(pivot_rtsv, query) AS rank",
from="rsc r, to_tsquery($1) query",
where=" query @@ pivot_rtsv and id <> $2",
order="rank desc",
order="rank desc, r.publication_start desc",
args=[TsQuery, z_convert:to_integer(Id)],
tables=[{rsc,"r"}]
}
Expand All @@ -300,7 +300,7 @@ search({match_objects_cats, [{id,Id}]}, _OffsetLimit, Context) ->
select="r.id, ts_rank(pivot_rtsv, query) AS rank",
from="rsc r, to_tsquery($1) query",
where=" query @@ pivot_rtsv and id <> $2",
order="rank desc",
order="rank desc, r.publication_start desc",
args=[TsQuery, z_convert:to_integer(Id)],
tables=[{rsc,"r"}]
}
Expand Down

0 comments on commit 94054b7

Please sign in to comment.