Thinking Sphinx not indexing newly added records

2019-04-10 09:04发布

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.

1条回答
放荡不羁爱自由
2楼-- · 2019-04-10 09:15

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.

查看更多
登录 后发表回答