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

  • Home
  • SEARCH
  • 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 581701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:36:28+00:00 2026-05-13T14:36:28+00:00

I have a Ruby on Rails site that uses thinking sphinx for searching a

  • 0

I have a Ruby on Rails site that uses thinking sphinx for searching a postgres database.

One of the fields in a table I am searching on is a boolean.
I’d like to be able to match on that boolean when a certain keyword is used in the search query.

To fully explain with an example:
My site is for people who develop their own black and white film.
I have a recipe table where people describe how they develop a film. That table has a boolean column called “stand_developed” (a method of developing film).
I’d like to return results where that field is true when the user searches for the word “stand”.

I’ve been through the sphinx docs and not really found if it’s possible.

I guess I could hack something inside my controller method by parsing the query terms and adding a condition but is there a cleaner way of doing it?

  • 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-05-13T14:36:28+00:00Added an answer on May 13, 2026 at 2:36 pm

    I’ve come up with a solution to this now.

    I tried the “hack” I mentioned in my question – parsing the word “stand” and searching for it explicitly (a variation on the answer from Paul Davis) but it didn’t work very well.

    I didn’t explain this in my question (didn’t realise the full implications at the time I asked) but I need it to also match if the user used the word “stand” in their recipe description too.

    So, I tried to get sphinx to add a condition along the lines of “if stand_developed is true or notes contains ‘stand'” but I couldn’t seem to find the right syntax for that.
    It also had to deal with any other search text too.

    In the end I added an extra column to my recipe table called “search_tags” and I add the word “stand” into it if the user selects “stand_developed” when adding a recipe.
    I then get Sphinx to index that field as well as my other fields and it all works perfectly.

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

Sidebar

Related Questions

I have a Ruby on Rails Website that makes HTTP calls to an external
I have a Ruby script in my Rails app that I use to load
In my Ruby on Rails app, I have a User table and a Foo
Suppose you have an ActiveRecord::Observer in one of your Ruby on Rails applications -
I am using ruby on rails with a MySQL backend. I have a table
Ruby on Rails controllers will automatically convert parameters to an array if they have
I have a polymorphic association in a Ruby on Rails model. In the migration,
I have been creating a website with Ruby on Rails, and will be hosting
I have been using ActiveResource in my Ruby on Rails applications for some time,
I am new to Ruby on Rails, I have completed the Blog Tutorial .

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.