Thanks for those details Mike.

At this point, my main suspicion is focused on the delta indexing.

Generally, the behaviour is as follows:

A ClientOrder instance is updated.
The delta processing fires, which has two parts:
Mark the core index records for that ClientOrder as deleted.
Process the ClientOrder delta index
Further searches find the ClientOrder instance from the delta index, ignoring 
the marked-as-deleted details in the core index.
When ts:index or ts:rebuild is fired, the changes available in the delta are 
now present in the core (and no longer marked as deleted).

I wonder if the "Process the ClientOrder delta index” step isn’t working - 
thus, the core records are marked as deleted, but there’s nothing new in the 
delta index, and so the updated instances aren’t present in searches. In your 
setup, this can happen when the web processes where the updating is happening 
don’t have knowledge of where Sphinx’s indexer tool is located - they don’t 
have the same PATH setup as your cron job or shell. The fix for this is to set 
bin_path in your config/thinking_sphinx.yml file for the appropriate 
environments:
https://freelancing-gods.com/thinking-sphinx/common_issues.html#passenger 
<https://freelancing-gods.com/thinking-sphinx/common_issues.html#passenger>

If you’ve already got bin_path set - and it’s the correct path - then I’m 
really not sure what is the cause of the problem.

As an aside, and I don’t think this is part of the problem, but I’d recommend 
just using ts:index instead of ts:rebuild - there shouldn’t be any need to stop 
Sphinx, delete all the files, and recreate the setup from scratch. At the very 
least, it’d be useful to know if ts:index does resolve the issue you’re seeing 
if the bin_path option doesn’t lead anywhere.

Cheers,

— 
Pat

> On 5 Oct 2017, at 9:21 pm, mikej <[email protected] 
> <mailto:[email protected]>> wrote:
> 
> Hi Pat,
> 
> I can't honestly remember if 'rake ts:index' fixes it.  I think not which is 
> why I went on to ts:rebuild.  I'll try again next time it happens.
> It does not happen every time I update ClientOrder.
> There are no callbacks impacting Client or Order.
> It just affects Sphinx index for ClientOrder.  There is no index for the 
> Order model although I did miss indexes in ClientOrder for Order as an 
> association. 
> E.g.
> indexes order.name,:as => :order_name
> Sphinx is hosted on the same machine as my app.
> I have never found any clues in the rails logs.
> 
> Thanks for you time, much appreciated.
> 
> Mike
> 
> -- 
> 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 https://groups.google.com/group/thinking-sphinx 
> <https://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 https://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.

Reply via email to