Permalink
Browse files

Log results-count

  • Loading branch information...
1 parent 323a3b7 commit 6f7f56e54b5fcb9c703276323370c3e9a45908a8 @rwdaigle committed Oct 9, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 app/models/gist.rb
View
@@ -49,7 +49,7 @@ def import(gh_gist)
def search(user, q)
log({ns: self, fn: __method__, query: q, measure: true, at: 'search'}, user)
- if(!q.blank?)
+ results = if(!q.blank?)
log({ns: self, fn: __method__, query: q, measure: true}, user) do
tire.search do
query { string q }
@@ -62,6 +62,9 @@ def search(user, q)
else
[]
end
+
+ log({ns: self, fn: __method__, query: q, measure: true, at: 'search-results'}, {:'result-count' => results.size}, user)
+ results
end
def reindex

0 comments on commit 6f7f56e

Please sign in to comment.