Thanks for the reply james. I caught the exception of
Riddle:ResponseError and rendered the page like that. Thanks a lot.

On Jun 2, 5:28 pm, James Healy <[email protected]> wrote:
> Dhaval wrote:
> > I got this error when I was playing with the url to make sure I do not
> > get any exception. Is there a way to avoid this?
> > I gave a page number in the url which does not exist and it thinking
> > sphinx throwed this error.
> > searchd error (status: 1): offset out of bounds (offset=1999960,
> > max_matches=1000).
>
> I have the following before filter in my application controller:
>
>   # ThinkingSphinx returns a maximum of 50 pages. Anything higher than
>   # that, we want to 404 to avoid a TS error.
>   def limit_page_param
>     if params[:page] && params[:page].to_i > 50
>       pretty_404
>     end
>   end
>
> pretty_404 is a method that renders a friendly 404 page.
>
> The filter gets called for every page, although it'd probably be better
> to just add it on actions that perform sphinx queries.
>
> -- James Healy <jimmy-at-deefa-dot-com>  Wed, 03 Jun 2009 09:22:29 +1000
--~--~---------~--~----~------------~-------~--~----~
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