You haven't added your own search method to the model, have you? -- Pat
On 30/07/2010, at 12:31 PM, T Untario wrote: > I don't have any search library installed, just thinking_sphinx and > sphinx. Do you think there's some other library that provide mixin for > activerecord? > > I just tried using global ThinkingSphinx.search, and it works fine!! > > I tried adding parentheses to Product.search too, but fail with the > same error message. I paste the whole application stack trace below. > Line 24 is the Product.search method call. > > ArgumentError in SearchController#index > > wrong number of arguments (2 for 3) > RAILS_ROOT: /mnt/hgfs/Projects/store-frontend > > Application Trace | Framework Trace | Full Trace > /mnt/hgfs/Projects/store-frontend/app/controllers/search_controller.rb: > 24:in `index' > /var/lib/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/ > base.rb:1331:in `perform_action' > /var/lib/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/ > filters.rb:617:in `call_filters' > /var/lib/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/ > filters.rb:610:in `perform_action_with_filters' > /var/lib/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/ > benchmarking.rb:68:in `block in perform_action_with_benchmark' > /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/ > core_ext/benchmark.rb:17:in `block in ms' > /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/ > core_ext/benchmark.rb:17:in `ms' > /var/lib/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/ > benchmarking.rb:68:in `perform_action_with_benchmark' > /var/lib/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/ > rescue.rb:160:in `perform_action_with_rescue' > /var/lib/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/ > flash.rb:151:in `perform_action_with_flash' > /var/lib/gems/1.9.1/gems/newrelic_rpm-2.12.1/lib/new_relic/agent/ > instrumentation/controller_instrumentation.rb:253:in `block in > perform_action_with_newrelic_trace' > /var/lib/gems/1.9.1/gems/newrelic_rpm-2.12.1/lib/new_relic/agent/ > method_tracer.rb:141:in `trace_execution_scoped' > /var/lib/gems/1.9.1/gems/newrelic_rpm-2.12.1/lib/new_relic/agent/ > instrumentation/controller_instrumentation.rb:246:in > `perform_action_with_newrelic_trace' > /var/lib/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/ > base.rb:532:in `process' > /var/lib/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/ > filters.rb:606:in `process_with_filters' > /var/lib/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/ > base.rb:391:in `process' > /var/lib/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/ > base.rb:386:in `call' > /var/lib/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/ > routing/route_set.rb:438:in `call' > > > > > > > > On Jul 30, 7:32 am, Pat Allan <[email protected]> wrote: >> I thought I approved this email, but it hasn't arrived yet - so I'll just >> reply anyway ;) >> >> Do you have any other search libraries installed that may be getting in the >> way? Also, what happens if you wrap the entire method call in parentheses? I >> don't think Ruby is getting confused about that, but no harm checking: >> >> Product.search((params[:q] || ''), :page => (params[:p] || 1)) >> >> -- >> Pat >> >> On 30/07/2010, at 2:27 AM, T Untario wrote: >> >> >> >>> Hello, >> >>> I'm new to both Sphinx and Thinking Sphinx. I'm following a tutorial >>> in Thinking Sphinx PDF from PeepCode when trying this search. >> >>> I'm using: >>> ubuntu 10.04 >>> rails 2.3.8 >>> ruby 1.9.1 >>> thinking-sphinx-1.3.18 (installed via gem) >>> sphinx 0.9.8 (installed via apt-get) >> >>> I created indexes and started the searchd, it went fine. >> >>> These are errors I found: >> >>> @products = Product.search (params[:q] || ''), :page => (params[:p] || >>> 1) >>> Error: Wrong number of argument (2 of 3) >> >>> If I omit the :page arguments >>> @products = Product.search (params[:q] || '') >>> Error: Wrong number of argument (1 of 3) >> >>> If I add any other arguments, like in: >>> @products = Product.search (params[:q] || ''), :page => (params[:p] || >>> 1), :with => {store_id => 1} >>> Error: Wrong number of argument (2 of 3) >> >>> I'm totally stuck, can't get past this .search problem, can't get any >>> result at all. >> >>> Thanks in advance. > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/thinking-sphinx?hl=en. > -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
