开发者

Thinking Sphinx Error - ResponseError (searchd error (status: 1): index lead_delta: attribute 'user_id' not found):

I got following error while updating Lead model data:

Riddle::ResponseError (searchd error (status: 1): in开发者_如何学Godex lead_delta: attribute 'user_id' not found): app/controllers/leads_controller.rb:88:in `block in update'

Everything was working fine until I changed search index in model, adding attribute user_id. After rebuilding sphinx index search is working Ok, but on update of Lead it shows error 500 and above mentioned message.

In Lead model I have following search indexes and attributes:

indexes client_name
indexes company
indexes product.name, :as => :lead_product 
indexes account_id
indexes email
indexes office_phone
indexes mobile_phone

has product_id, account_id, user_id

where "lead_converted = 0"

set_property :delta => :delayed

Controller Leads

def update

@lead = Lead.find params[:id] respond_to do |format|

Line 88: if @lead.update_attributes params[:lead]

I have following gem versions:

'thinking-sphinx', '2.0.3'

riddle (1.3.3)


Are you running the ts:rebuild rake task? Or ts:index? The former is what's necessary, as it looks like the Sphinx daemon isn't aware of your new attribute (rebuild stops Sphinx, reindexes, and then starts Sphinx up again).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜