mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
load tags before body is processed
This commit is contained in:
parent
54ed9b5c43
commit
1225aced41
1 changed files with 6 additions and 7 deletions
|
@ -24,11 +24,16 @@ defmodule PhilomenaWeb.ImageLoader do
|
|||
queryable = Keyword.get(options, :queryable, Image |> preload(:tags))
|
||||
constant_score = Keyword.get(options, :constant_score, true)
|
||||
|
||||
tags =
|
||||
body
|
||||
|> search_tag_names()
|
||||
|> load_tags()
|
||||
|> render_bodies(conn)
|
||||
|
||||
user = conn.assigns.current_user
|
||||
filter = conn.assigns.compiled_filter
|
||||
filters = create_filters(conn, user, filter)
|
||||
body = maybe_constant_score(body, constant_score)
|
||||
|
||||
records =
|
||||
Elasticsearch.search_records(
|
||||
Image,
|
||||
|
@ -45,12 +50,6 @@ defmodule PhilomenaWeb.ImageLoader do
|
|||
queryable
|
||||
)
|
||||
|
||||
tags =
|
||||
body
|
||||
|> search_tag_names()
|
||||
|> load_tags()
|
||||
|> render_bodies(conn)
|
||||
|
||||
{records, tags}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue