Jenny Blunt
Jenny Blunt

Reputation: 1596

Delta Indexing Only Working in Console

I'm running sphinx, thinking sphinx on our rails3 application. I'm also using passenger on osx 10.6.

Everything's fine but I simply cannot get my delta indexes to work when I create a record in a browser.

In the console, I get the following output and my record's displayed in the view:

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>

I've been through the documentation, rebuilt my indexes etc. The only thing I can assume is that it's a permissions problem. The docs say searchd has to be run as same user as www.

Apache2 is running as www user on my mac. I can't see why I should change this to run as ts user?

-- UPDATE --

Sphinx.rb:

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

Upvotes: 0

Views: 403

Answers (2)

Jenny Blunt
Jenny Blunt

Reputation: 1596

After some investigation, I found an error appearing when adding a company through the browser...

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

To solve this mysql load issue, I followed the following suggestion and ran this:

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

Now, creating a record in the browser, I can see my delta indexing working again. woohoo!

Hope this helps someone out there...

Upvotes: 1

Anatoly
Anatoly

Reputation: 15530

mem_limit setup as 0 can't be used. can you tune your thinking_sphinx configuration with according to official documentation?

development: mem_limit: 128M

Upvotes: 0

Related Questions