Skip to content

Commit

Permalink
Don't require body
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtOfCode- committed May 25, 2020
1 parent c57a2f3 commit 16cca58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def index
end
end

if (body_operation == 'LIKE' || body_operation == 'NOT LIKE') && user_signed_in? && params[:body_is_like] != '1'
if ['LIKE', 'NOT LIKE'].include?(body_operation) && user_signed_in? && params[:body_is_like] != '1' && body.present?
# If the operation would be LIKE, hijack it and use our fulltext index for a search instead.
# UNLESS... params[:body_is_like] is set, in which case the user has explicitly specified a LIKE query.
@results = @results.match_search(body, with_search_score: false, posts: :body)
Expand Down

0 comments on commit 16cca58

Please sign in to comment.