FIX: Searching for post content without intitial results was not working

This commit is contained in:
Robin Ward 2013-05-29 17:52:09 -04:00
parent 19b4680944
commit 3dfb9f0c2f
1 changed files with 2 additions and 1 deletions

View File

@ -89,7 +89,8 @@ class Search
expected_topics = Search.per_facet * Search.facets.size if @results.type_filter == 'topic'
expected_topics -= @results.topic_count
if expected_topics > 0
extra_posts = posts_query(expected_topics * Search.burst_factor).where("posts.topic_id NOT in (?)", @results.topic_ids)
extra_posts = posts_query(expected_topics * Search.burst_factor)
extra_posts = extra_posts.where("posts.topic_id NOT in (?)", @results.topic_ids) if @results.topic_ids.present?
extra_posts.each do |p|
@results.add_result(SearchResult.from_post(p))
end