Skip to content

Commit

Permalink
Merge pull request #1508 from codidact/0valt/1507/search-fix
Browse files Browse the repository at this point in the history
Followup fix for search
  • Loading branch information
ArtOfCode- authored Jan 9, 2025
2 parents 41de9b2 + 07e1983 commit 91c0902
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 91c0902

Please sign in to comment.