Search code examples
mysqlrubyruby-on-rails-3thinking-sphinx

sphinx search max_matches not working using sphinx.yml file


I am using sphinx search in my rails project. I have sphinx.yml file, i-e.

   defaults: &defaults

   enable_wildcard: 1

   min_prefix_len: 2

   enable_star: 1

   max_matches: 25000

   development:

     <<: *defaults

   test:

     <<: *defaults

   production:

     <<: *defaults

     pid_file: "RAILS_ROOT/log/searchd.pid"

     searchd_file_path: "RAILS_ROOT/config/db/sphinx"

     indexer_binary_name: "/usr/local/bin/indexer"

     searchd_binary_name: "/usr/local/bin/searchd"

     port: 9314

In my controller's action, i have follwing code.

    Application.search(query,:with => options,:order => "updated_at DESC",:max_matches=> 25_000,
                                                                   :match_mode => :extended).page(params[:page]).per(11)

i am getting error like this.

       searchd error (status: 1): per-query max_matches=25000 out of bounds (per-server max_matches=1000)

Any good suggestion?? please.


Solution

  • You need to increase max_matches in sphinx.conf and restart searchd process. max_matches is a searching setting , has nothing to do with indexing process.