0

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.

Ramiz Raja
  • 5,942
  • 3
  • 27
  • 39
  • Have you rebuilt your index since making the change? – MrTheWalrus Oct 09 '12 at 14:45
  • Yes, i rebuilt but it didn't work. – Ramiz Raja Oct 09 '12 at 19:57
  • Odd. Tried this and it worked (though I'm using postgres rather than mysql). Does the correct value appear in your sphinx.conf file? (`max_matches = 25000` in the block for searchd) – MrTheWalrus Oct 09 '12 at 20:51
  • Other people with a similar issue around the interwebs generally either had an out-of-date version of TS, or hadn't actually managed to restart searchd after making the change. Not sure if either applies to you. – MrTheWalrus Oct 09 '12 at 21:01

1 Answers1

2

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.

aditirex
  • 692
  • 3
  • 12