Delta Indexing仅在控制台中工作

时间:2011-07-18 08:29:17

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

我正在运行sphinx,在我们的rails3应用程序上思考sphinx。我也在osx 10.6上使用乘客。

一切都很好,但是当我在浏览器中创建记录时,我根本无法使delta索引工作。

在控制台中,我得到以下输出,我的记录显示在视图中:

Sphinx 2.0.2-dev (r2875)
Copyright (c) 2001-2011, Andrew Aksyonoff
Copyright (c) 2008-2011, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/Users/jennyb/railsprojects/orders/config/development.sphinx.conf'...
indexing index 'company_delta'...
WARNING: collect_hits: mem_limit=0 kb too low, increasing to 14336 kb
collected 2 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 2 docs, 30 bytes
total 0.009 sec, 3291 bytes/sec, 219.44 docs/sec
total 3 reads, 0.000 sec, 0.2 kb/call avg, 0.0 msec/call avg
total 9 writes, 0.000 sec, 0.2 kb/call avg, 0.0 msec/call avg
rotating indices: succesfully sent SIGHUP to searchd (pid=48890).
=> #<Company id: 26, name: "Bobs Your Uncle", number: "123456", address: "204 Some Studio", town: "London", postcode: "W1", phone: "0207123456", createdby: nil, user_id: nil, created_at: "2011-07-18 08:24:26", updated_at: "2011-07-18 08:24:26", notes: nil, vip: nil, delta: true>

我已经阅读了文档,重建了我的索引等。我唯一可以假设的是它是权限问题。文档说searchd必须以与www。

相同的用户身份运行

Apache2在我的mac上以www用户身份运行。我不知道为什么我应该改变这个以ts用户身份运行?

- 更新 -

Sphinx.rb:

development:
  min_infix_len: 3
  bin_path: "/usr/local/bin"
  version: 2.0.5
  mem_limit: 128M

2 个答案:

答案 0 :(得分:1)

经过一些调查后,我发现在通过浏览器添加公司时出现错误...

dyld: Library not loaded: libmysqlclient.18.dylib
  Referenced from: /usr/local/bin/indexer
  Reason: image not found

要解决这个mysql加载问题,我按照following suggestion运行了这个:

sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/bin/indexer

sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/bin/search

现在,在浏览器中创建一条记录,我可以看到我的delta索引再次运行。哇噢!

希望这可以帮助那些人...

答案 1 :(得分:0)

不能使用mem_limit设置为0。你可以根据official documentation调整你的thinking_sphinx配置吗?

发展:   mem_limit:128M

相关问题