The delayed indexing is working fine but on record save it sends some delete request to websolr... here in the log it shows
SOLR Request (14.3ms) [ path=# parameters={data: Message 547488, headers: {"Content-Type"=>"text/xml"}, method: post, params: {:wt=>:ruby}, query: wt=ruby, path: update, uri: http://index.websolr.com/solr/index/update?wt=ruby, open_timeout: , read_timeout: } ]
SOLR Request (12.4ms) [ path=# parameters={data: Message 547488, headers: {"Content-Type"=>"text/xml"}, method: post, params: {:wt=>:ruby}, query: wt=ruby, path: update, uri: http://index.websolr.com/solr/index/update?wt=ruby, open_timeout: , read_timeout: } ]
SOLR Request (9.7ms) [ path=# parameters={data: , headers: {"Content-Type"=>"text/xml"}, method: post, params: {:wt=>:ruby}, query: wt=ruby, path: update, uri: http://index.websolr.com/solr/index/update?wt=ruby, open_timeout: , read_timeout: } ]
These are the 3 requests that has been made against single message creation.
here is my search block
searchable :if => proc { |message| !message.user_messages.blank? } do
text :message_body do
CGI.escape(self.body || "")
end
text :subject do
CGI.escape(self.subject || "")
end
text :sender_name do
user.blank? ? "" : user.full_name
end
integer :users_ids, :multiple => true do
user_messages.map{|um| um.user_id}
end
time :created_at
end handle_asynchronously :solr_index
Please look in it asap,
thanks
To queue Sunspot deletes with DelayedJob, you should also add this line:
handle_asynchronously :remove_from_index
remove_from_index
into your model. Read this: http://blog.bigbinary.com/2012/10/11/solr-sunspot-websolr-delayed-job.htm - Chris Peters 2013-08-20 11:23