Created
July 26, 2011 20:09
-
-
Save vanstee/1107876 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if top_score = top_hits.map(&:score).max | |
- top_hits.detect { |h| h.score == top_score }.result | |
+ sid = top_hits.detect { |h| h.score == top_score }.stored(:demandbase_sid) | |
+ Company.find_by_demandbase_sid(sid) | |
elsif not options.keys.include?(:country) | |
# There's no location information or no matches based on location | |
# revert to a search with no scope | |
- solr_hits(q, options, nil).first.try(:result) | |
+ sid = solr_hits(q, options, nil).first.stored(:demandbase_sid) | |
+ Company.find_by_demandbase_sid(sid) | |
else | |
nil | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment