Permalink
Browse files

Only fetch required fields from search

  • Loading branch information...
1 parent 89b8920 commit 41997d5e7e24457fa5f8ba4330d64f087c82018e @rwdaigle committed Oct 12, 2012
Showing with 3 additions and 1 deletion.
  1. +2 −1 app/models/gist.rb
  2. +1 −0 app/views/gists/search.html.haml
View
@@ -55,9 +55,10 @@ def search(user, q)
log({ns: self, fn: __method__, query: q, measure: true}, user) do
tire.search do
query { string q }
+ fields [:description, :url, :public, :gh_updated_at, :id]
# sort { by :gh_created_at, 'desc' }
filter :term, :user_id => user.id
- highlight :description, :'files.content', :options => { :tag => "<b>" }
+ highlight :description, :options => { :tag => "<em>" }
size 15
end
end
@@ -10,6 +10,7 @@
- for result in @results
%li
%p= search_result_link(result)
+ / %p= result.inspect
/ %p.files= files_display(result)
/ - if(result.highlight && result.highlight[:'files.content'])
/ - highlights = result.highlight[:'files.content']

0 comments on commit 41997d5

Please sign in to comment.