4

I am using sphinx to search on 2 models along with their associations. I am using delta indexing. Things work fine on my dev box in dev mode (Ubuntu). However, on staging box production env, when I create new records, I need to build the index again in order to make the newly created records searchable. Even weird is that when I create records using script/console, they seem to be getting indexed and are searchable.

For the associations to work after update, I have an after_save method for all the association models that set the delta of these two model records to true. I am not sure if this has anything to do with this.

I have checked for permissions, thinking sphinx gem version and they all seem to be fine. What could be wrong?

EDIT

I have also checked out http://freelancing-god.github.com/ts/en/common_issues.html#deltas but it doesn't seem to work. And yes the server runs on phusion passenger.

Chirantan
  • 15,304
  • 8
  • 49
  • 75
  • what do your index blocks look like in your models? why are you setting delta to false (how is that important for the associations?). delta has to be true for a record to get delta indexed – Jason Yanowitz Jan 13 '10 at 16:36
  • Sorry I mean, deltas are being set to true for association updates to work. It is definitely a phusion passenger issue. – Chirantan Jan 14 '10 at 10:07
  • Are you sure it's a phusion passenger issue? Have you tried doing rails s and seing if you can get search results? I'm having a similar issue, I also have phusion passenger set up, but I also notice that in rails console searching via the Modelname instance (or whatever) always return a []. I also notice that there is a line in the output of rake ts:rebuild "skipping non-plain index" Let me know if this helps... – Adam Miller Jul 12 '12 at 21:43
  • have you tried using ruby-debug? – Adam Miller Jul 12 '12 at 23:22

1 Answers1

1

I had something like this exact issue, and I think it was a dependency resolution issue.

See my post here.

Somehow, I think an updated version of thinking-sphinx got installed on my machine via a gem, and I still had it installed via apt-get. I purged it with apt, and then reinstalled it. Afterward, I found that I had a special field in a table that should not be used, :type, and I edited the migration to remove the type and add it again as a different name. Then it worked. You should post your relevant code, for the models, the controller action that calls search, any conspicuous output on calling any of the rake commands. Try uninstalling the gem and then reinstalling it. Then uninstall the apt package, and reinstall it.

Community
  • 1
  • 1
Adam Miller
  • 1,756
  • 1
  • 25
  • 44