undefined method `search' for #<Class:0x0000001f482690>

593 views
Skip to first unread message

SteveS

unread,
Sep 5, 2013, 2:29:24 AM9/5/13
to thinkin...@googlegroups.com
Hi all, I know there has to be a simple answer for this.. I'm brand new to thinking sphinx and I believe I have everything setup, but when I try to use the line "@servers = Server.search(params[:search], :ranker => :proximity, :match_mode => :any)" in my controller, I get the error "undefined method `search' for #<Class:0x0000001f482690>" on the web page.  Everything works fine when I remove the Server.search call.

Here is a bit of output from my rake commands, I don't believe the deprecation warning is the root of my problem:

rake ts:index
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /var/www/inventory/Rakefile:10)
Generating configuration to /var/www/inventory/config/development.sphinx.conf
Sphinx 2.0.8-id64-release (r3831)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/var/www/inventory/config/development.sphinx.conf'...
indexing index 'server_core'...
collected 365 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 365 docs, 11221 bytes
total 0.457 sec, 24518 bytes/sec, 797.54 docs/sec
total 3 reads, 0.000 sec, 9.3 kb/call avg, 0.0 msec/call avg
total 9 writes, 0.000 sec, 6.2 kb/call avg, 0.0 msec/call avg


rake ts:start
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /var/www/inventory/Rakefile:10)
Started searchd successfully (pid: 25269).


This is my server_index.rb file:

ThinkingSphinx::Index.define :server, :with => :active_record do
  indexes ipaddress, hostname, virtual
end


Please let me know if posting any other configs would be beneficial, any help would be appreciated.  I've been stuck on this for quite a while now..

Steve


SteveS

unread,
Sep 9, 2013, 4:12:32 AM9/9/13
to thinkin...@googlegroups.com
Nothing?  Ouch..

Pat Allan

unread,
Sep 9, 2013, 4:37:00 AM9/9/13
to thinkin...@googlegroups.com
Sorry Steve, I'm falling a bit behind on TS support over the last week.

There's nothing odd in your rake outputs, nor your index definition. Does the call work in the Rails console? What version of Rails are you using? And have you restarted your Rails app since adding thinking-sphinx into your Gemfile? What version of thinking-sphinx are you using?

-- 
Pat

--
You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thinking-sphi...@googlegroups.com.
To post to this group, send email to thinkin...@googlegroups.com.
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages