1

I have a callback on a Model in my rails app as follows

after_save :sunspot_index

def sunspot_index
  Sunspot.index( self )
  Sunspot.commit  
end

This works great on my local machine and as soon as I update an instance of the class, it's index entry is updated and it's searchable with it's new attributes.

However this same code does not work when deployed to Heroku. This upsets me deeply. Is there an environment/solr config difference preventing this from working?

I'm using Sunspot 1.2.x

UPDATE: It seems the reindex does take place, but after a minute or so.

4

1 に答える 1

2

It turns out Websolr who provide the Solr instances as an add-on on Heroku also have a 60 sec delay on commits.

Read more here:

http://help.websolr.com/discussions/questions/269-how-do-i-turn-on-real-time-indexing

于 2012-05-16T14:46:23.097 に答える