To answer your first question: Yes, defining your own after_save is
the way to go.
To answer your second question: Solr does not support the concept of
partial updates -- under the hood, updating a document actually
consists of removing it from the index and then re-adding it. So,
Sunspot does have to construct the full document each time anything
changes; it's an unfortunate limitation from a performance standpoint,
but it's pretty fundamental to the way Solr and Lucene work. If you
are constructing complex documents out of many associated models, I
would heartily suggest performing your indexing in the background
using something like DJ or Resque so your server response times don't
suffer.
Mat
> --
> You received this message because you are subscribed to the Google Groups "Sunspot" group.
> To post to this group, send email to ruby-s...@googlegroups.com.
> To unsubscribe from this group, send email to ruby-sunspot...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ruby-sunspot?hl=en.
>
>