[LRUG] Sphincter Search: Works In Console, Not In App

Andrew Stewart boss at airbladesoftware.com
Thu Feb 28 10:19:37 PST 2008


Hi LRUG,

I'm using Sphincter to index and search models in my Rails app.

http://seattlerb.rubyforge.org/Sphincter/

I have decorated my models and indexed the database.  When I fire up  
script/console, I get the results I expect for something like:

 >> User.search 'andy'

When I run the same search via a controller in my app, it returns  
different results.  Even if I bounce Mongrel and the searchd process  
a few times, I still get the same wrong results.

It's all rather tiresome.  Given the evidence I've just described, I  
assume the problem lies in my controller.  But it does exactly what I  
do from the console, specifically:

def show
   @results = User.search 'andy'
end

Yet the content of @results differs from the results I get in the  
console.

Any ideas for debugging this?

Thanks and regards,
Andy Stewart


-------
http://airbladesoftware.com






More information about the Chat mailing list