Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9045629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:23:38+00:00 2026-06-16T11:23:38+00:00

User model has defined indexes to be searched using ThinkingSphinx . However when I

  • 0

User model has defined indexes to be searched using ThinkingSphinx. However when I stop my searchd deamon, I would like my method to fail gracefully and not throw an error. Normally I do this by using a rescue block for catching exceptions. But in this case, it still throws the error and the puts statement is never executed.

def search_users(key)
  begin
    search_results =  User.search(key,options)
  rescue Exception
    puts "Hello World!!!"
    search_results = []
  end
  return search_results
end

Following is the error i get:

Riddle::ConnectionError (Connection to 127.0.0.1 on 3201 failed. Connection refused - connect(2)):

Is there any way out?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:23:39+00:00Added an answer on June 16, 2026 at 11:23 am

    Solved it.

    Add the :populate => true option to your search calls.

    Normally, Thinking Sphinx lazily loads search results (allowing for
    sphinx scopes and such) – but if you want the rescue to take effect,
    then you’ll need to force the results to load immediately – hence the
    :populate option.

    Refer the link posted above for further reading.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a model User that has defined in user.rb many relationships like has_many
My user model has three relations for the same message model, and is using
I have a model defined like this: class UserDetail(models.Model): user = models.ForeignKey(User, db_index=True, unique=True,
I have a core data model defined as follows: A User has many events.
I currently have two different models: User and Project . The User model has
I have a User model that has many posts. Im trying to render the
I have a User model that has the following default_scope: default_scope where(account_id: Account.current_account.id) If
I have a model that has a ForeignKey to the built-in user model in
My Rails 2.3 application has a User model and the usual controller actions. The
I have a User model and a Submission model. Each Submission has a ForeignKey

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.