Hi Andrea
Your suggested approach will certainly do the job - and it’s the expected
interface for all delta libraries, so it’s unlikely to change. There’s also the
ability to suspend deltas, if that suits?
ThinkingSphinx::Deltas.suspend :article do
# add/update many article records
end
Cheers
—
Pat
> On 7 Jan 2015, at 3:39 pm, Andrea S. <[email protected]> wrote:
>
> Ok, so after poking around in the source code for a bit, I found an easy way
> to trigger the delta indexing after the mass insert. Given that the delta
> attribute of all the newly inserted records is true, you can simply run:
>
>
> ThinkingSphinx::Deltas::IndexJob.new('delta_index_name').perform
>
> Are there any side effects or caveats with this approach that I should be
> aware of?
>
> On Tuesday, January 6, 2015 2:14:52 PM UTC-8, Andrea S. wrote:
> I have a very large main index and am using the SidekiqDelta adapter for
> delta indexing. A full re-index currently takes hours to complete.
>
> My current workflow consists of adding large amounts of data (often millions
> of rows of the indexed model) in optimized data import tasks that mass insert
> rows into the MySQL database directly, essentially side-stepping
> ActiveRecord. This way of adding new records does not trigger the delta
> indexing and I also wouldn't want to add the new records to the delta index
> one by one. I usually end up running a full re-index after data import, but
> this has become a bottleneck.
>
> Is there a command in Thinking Sphinx to add all the newly inserted records
> to the delta index all at once? Or should I use the indexer command directly?
> What would be the best way of handling this kind of situation (maybe even
> different kinds of indexes)?
>
> Thanks,
>
> Andrea
>
> --
> You received this message because you are subscribed to the Google Groups
> "Thinking Sphinx" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/thinking-sphinx
> <http://groups.google.com/group/thinking-sphinx>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.