Skip to content

Commit

Permalink
search_posts method of SearchHelper wasn't assigning query updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Oaphi committed Jan 9, 2025
1 parent 41de9b2 commit 07e1983
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/helpers/search_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def search_posts
posts = qualifiers_to_sql(qualifiers, posts)
posts = posts.paginate(page: params[:page], per_page: 25)

if search_string.present?
posts.search(search_data[:search]).user_sort({ term: params[:sort], default: :search_score },
relevance: :search_score, score: :score, age: :created_at)
else
posts.user_sort({ term: params[:sort], default: :score },
score: :score, age: :created_at)
end
posts = if search_string.present?
posts.search(search_data[:search]).user_sort({ term: params[:sort], default: :search_score },
relevance: :search_score, score: :score, age: :created_at)
else
posts.user_sort({ term: params[:sort], default: :score },
score: :score, age: :created_at)
end

[posts, qualifiers]
end
Expand Down

0 comments on commit 07e1983

Please sign in to comment.