Hi Eric

Your best bet is to wrap the search call in a begin/rescue block, and retry at 
least once (but have a limit on the number of retries - and maybe check the 
error message).

Make sure you pass :populate => true in to the search call to ensure the 
results aren't lazily loaded, otherwise the error doesn't occur until you're 
looking at the search results (usually in the views).

Cheers

-- 
Pat

On 28/10/2011, at 12:25 AM, Eric wrote:

> I had a few exceptions like this come through:
> 
> ThinkingSphinx::SphinxError: index not preread
> [GEM_ROOT]/gems/thinking-sphinx-2.0.9/lib/thinking_sphinx/search.rb:
> 423:in `populate'
> [GEM_ROOT]/gems/thinking-sphinx-2.0.9/lib/thinking_sphinx/search.rb:
> 568:in `call'
> [GEM_ROOT]/gems/thinking-sphinx-2.0.9/lib/thinking_sphinx/search.rb:
> 568:in `retry_on_stale_index'
> [GEM_ROOT]/gems/thinking-sphinx-2.0.9/lib/thinking_sphinx/search.rb:
> 411:in `populate'
> [GEM_ROOT]/gems/thinking-sphinx-2.0.9/lib/thinking_sphinx/search.rb:
> 176:in `method_missing'
> 
> It appears that a delta re-index occurred just at the same time that I
> was doing a query on the same index.  Any ideas what could cause that?
> 
> I'm using Sphinx 2.0.1-id64-beta (r2792)
> 
> Thanks,
> Eric
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" 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/thinking-sphinx?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" 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/thinking-sphinx?hl=en.

Reply via email to