index not preread

365 views
Skip to first unread message

Eric

unread,
Oct 27, 2011, 5:25:12 PM10/27/11
to Thinking Sphinx
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

Pat Allan

unread,
Oct 27, 2011, 11:27:24 PM10/27/11
to thinkin...@googlegroups.com
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

> --
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
>

Reply all
Reply to author
Forward
0 new messages