Hi Mike

Not sure if this is the case in your actual code - but the model parts of index 
names are singular, not plural - so:

  ThinkingSphinx::Deltas::IndexJob.new(‘model_a_delta’).perform

A slight difference, though… perhaps irrelevant if you’re using the singular 
form in your actual code?

Are you finding deltas are generally working well when modifying an instance of 
ModelA directly? Is this issue happening locally, or just on production?

— 
Pat

> On 30 Apr 2015, at 8:22 pm, mikej <[email protected]> wrote:
> 
> I realise this has been addressed before.  I have tried various methods of 
> making this work with no success.  It works in development, but not 
> production.  As you can see from the details below, no records are found 
> after an update until ts:index is run.
> 
> Any ideas gratefully received.
> 
> many thanks,
> 
> Mike
> 
> class ModelA 
> 
>   belongs_to :model_b
> 
> end
> 
> 
> 
> class ModelB 
> 
>   has_many :model_a
> 
>   after_save :set_legislation_per_clients_delta_flag
> 
> 
> 
>   def set_model_a_delta_flag
> 
>     self.model_as.update_all(delta: true)
> 
>     ThinkingSphinx::Deltas::IndexJob.new('model_as_delta').perform
> 
>   end
> 
> end
> 
> 
> 
> model_b_index.rb
> 
> ThinkingSphinx::Index.define :model_a, :with => :active_record, :delta => 
> true do
> 
>     indexes model_b.title,:as => :model_b_title
> 
> end
> 
> 
> 
> model_b = ModelB.last
> 
> ModelA.search("XXXX")
> 
> []
> 
> bundle exec rake RAILS_ENV=production ts:index
> 
> ModelA.search("XXXX")
> 
> [1 record found]
> 
> The delta has been set to true in model_a for both searches above.
> 
> 
> 
> Sphinx 2.2.7
> 
> thinking-sphinx 3.1.3
> 
> rails 3.2.21
> 
> 
> -- 
> 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.

Reply via email to