sphinx搜索max_matches使用sphinx.yml文件无效

时间:2012-10-09 14:41:39

标签: mysql ruby ruby-on-rails-3 thinking-sphinx

我在我的rails项目中使用sphinx搜索。我有sphinx.yml个文件,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

在我的控制器动作中,我有以下代码。

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

我收到这样的错误。

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

有什么好建议吗?请。

1 个答案:

答案 0 :(得分:2)

您需要在sphinx.conf中增加max_matches并重新启动searchd进程。 max_matches是一个搜索设置,与索引过程无关。

相关问题