title: OR Logic with Attribute Filters in Sphinx
body: <p>I have a use case where I need to use OR logic with attribute filters. Here is the scenario, User has many roles and has an attribute called global. Below is the index block</p>
  
  <pre><code>define_index do
    has roles(:id), :as =&gt; :role_ids
    has global
  end
  </code></pre>
  
  <p>And I need to get users with have roles with id 5 or the users  with global true. Here is the query I am trying to use</p>
  
  <pre><code>User.search(
       :sphinx_select =&gt; "*, IF(global OR role_ids = 5, 1, 0) AS program_global",
       :with =&gt; {'program_global' =&gt; true},
       :match_mode =&gt; :extended
  )
  </code></pre>
  
  <p>This results in a syntax error -  unexpected TOK_ATTR_MVA near 'role_ids = 5, 1, 0)' . The problem here seems to be that role_ids is a MVA. I am using sphinx 0.9.9</p>
  
  <p>Any help?</p>