replace Article entity by Article request for the HTTP request

Add draft
This commit is contained in:
2019-09-16 22:47:37 +02:00
parent 05c28a2f62
commit c2beed416e
13 changed files with 157 additions and 73 deletions

View File

@@ -9,7 +9,7 @@ create or replace function find_articles(
) language plpgsql as
$$
begin
select json_agg(t), (select count(id) from article a where (_search is null or _search = '' or a ==> dsl.multi_match('{title^3, content, description}', _search)) and a.is_last_version = true)
select json_agg(t), (select count(id) from article a where (_search is null or _search = '' or a ==> dsl.multi_match('{title^3, content, description}', _search)) and a.last_version = true)
into resource, total
from (
select
@@ -21,7 +21,7 @@ begin
_search is null
or _search = ''
or a ==> dsl.multi_match('{title^3, content, description}', _search)
) and a.is_last_version = true
) and a.last_version = true
order by
_score desc,
case direction when 'asc' then