Question

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

Was it helpful?

Solution

To queue Sunspot deletes with DelayedJob, you should also add this line:

handle_asynchronously :remove_from_index
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top