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 3965112
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:25:08+00:00 2026-05-20T03:25:08+00:00

This question is in a way related to this other question: Sphinx Filters –

  • 0

This question is in a way related to this other question: Sphinx Filters – Can I have an 'OR' between filters attributes?

It seems to me that sphinx now has support for OR logic to filter with attributes, but there is no way to use that feature through thinking sphinx.

Is it possible to use any complex logic to filter with attributes in thinking sphinx? Basically, what I’m trying to do is specify conditions on attributes in my search, for example something like: a OR ((NOT a) AND b), I would use it like so:

( (attribute_a == true) OR (attribute_a == false AND attribute_b IN [x,y,z]) )

Or something similar to that. The problem is that both :with and :without expect a hash and join each condition with an AND (or AND NOT), if I’m not mistaken.

  • 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-20T03:25:09+00:00Added an answer on May 20, 2026 at 3:25 am

    Hi Sorenly
    You can probably use something like this

    Model.search “(@field_name1 value1 | value2) (@field_name2 value3 | value4),:match_mode => :extended

    Here ‘|’ is equated to or by sphinx and space is equated to an and.

    ( (attribute_a == true) OR (attribute_a == false AND attribute_b IN [x,y,z]) )
    =>

    Model.search “((@attribute_a 1) |
    (attribute_a 0 (attribute_b x|y|z) )
    )”,:match_mode => :extended

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

Sidebar

Related Questions

Found this question that explained a way to communicate between layers. However there is
This question is related to this my question . Now I have form in
This is very closely related to this other question , but that question wanted
This is related to this question I have a vector of points that will,
This question is related to this one: Best way to store product colors in
This is the best way I can think of phrasing this question, given this
Similar to this question only the other way of flow. Insert Picture into SQL
hello i have this question i was trying to find a way to call
In this question , Codygman gave an answer that some operators offer a way
This question is related to this other question I recently asked... cf.net exception and

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.