Skip to content

Instantly share code, notes, and snippets.

@dblack
Created June 20, 2011 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dblack/1035652 to your computer and use it in GitHub Desktop.
Save dblack/1035652 to your computer and use it in GitHub Desktop.
ree-1.8.7-2010.02 :001 > res = Team.search { keywords "Mets" }
=> <Sunspot::Search:{:defType=>"dismax", :q=>"Mets", :rows=>30, :start=>0,
:fl=>"* score", :qf=>"name_text", :fq=>["type:Team"]}>
ree-1.8.7-2010.02 :002 > res.results
=> [#<Team _id: BSON::ObjectId('4dfa2262508c319700000001'), name: "Mets">]
ree-1.8.7-2010.02 :003 > Team.reindex(:batch_size => false)
=> {"responseHeader"=>{"QTime"=>137, "status"=>0}}
ree-1.8.7-2010.02 :004 > res = Team.search { keywords "Mets" }
=> <Sunspot::Search:{:defType=>"dismax", :q=>"Mets", :rows=>30, :start=>0,
:fl=>"* score", :qf=>"name_text", :fq=>["type:Team"]}>
ree-1.8.7-2010.02 :005 > res.results
=> []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment