I am trying to figure out the best way to handle full-text indexing on
my app. The docs (http://docs.heroku.com/full-text-indexing) provide a
great starting point, but I would like some more details.

As far as I know, I have a "small dataset:"
* 3 tables
* < 3000 rows in each table
* total size of the index on my local machine is 4.4MB (using a copy
of my production data)

So Heroku recommends acts_as_ferret with the caveat that it "will
require rebuilding the indexes every time a new app server is
launched."

I think this is the point that I need clarified. I know an app server
is launched when I deploy changes (git push heroku master), but when
else is a new app server launched?

On my development machine, my indexes take about 20-40 seconds to
rebuild. On Heroku they seem to take 40-60 seconds. This is obviously
too long for a normal request because Heroku times out after 30
seconds or so (with an error screen I can't customize). (And of course
I never want to keep an actual user waiting 60 seconds for a normal
request.)

So I am stuck needed to rebuild the Ferret indexes every time a new
app server is launched, but BEFORE a user actualy sends a search to
the new app server. How do I go about doing this? (Side question, if I
am using multiple Dynos, will they share the index? I don't see how
they could since the index is stored in the temporary directory. This
implies I need to rebuild my indexes separately for each Dyno.)

I have a few ideas, but because I don't understand enough of how the
Heroku stack works, I'm not quite sure which is the best.

Idea 1. Add an initializer which starts a delayed job to rebuild the
indexs (if required).
Idea 2. Add a timeout (set to a shorter time than Heroku's timeout) in
my search controller which gives the user a message saying that the
indexes are being rebuilt, the page will refresh and show him results
within 30 seconds.
Idea 3. None of this will work, I need to user Solr.

Thanks in advance for any insight you can provide.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to