title: No fields in schema - will not index - Sphinx
body: <p>I am using Sphinx, I have successfully built indexes with simpler queries but when I added the <code>COALESCE</code> and <code>AS</code> MySQL keywords to my query, I am getting the error "<strong>No fields in schema - will not index</strong>". I want to add attributes so I don't have to query the database for id match details, thought it would be a little faster, if I use sql_field_string in place of sql_attr_string I no longer get the error and the index builds but it takes triple the time to build.</p>
  
  <pre><code>SELECT r.RegistrationId, coalesce(CampaignID,'') as CampaignId, coalesce(FirstName,'') as FirstName, coalesce(LastName,'') as LastName, \
          coalesce(Address1,'') as Address1, coalesce(Address2,'') as Address2, coalesce(City,'') as City, coalesce(State,'') as State, \
          coalesce(Zip,'') as Zip,coalesce(Email,'') as Email, coalesce(Phone,'') as Phone,coalesce(Affiliate,'') as Affiliate, \
          coalesce(SubAffiliate,'') as SubAffiliate \
          FROM Registration r WHERE r.CreateDT &gt;= '2013-01-01'
          sql_attr_string = CampaignId
          sql_attr_string = FirstName
          sql_attr_string = LastName
          sql_attr_string = Address1
          sql_attr_string = Address2
          sql_attr_string = City
          sql_attr_string = State
          sql_attr_string = Zip
          sql_attr_string = Email
          sql_attr_string = Phone
          sql_attr_string = Affiliate
          sql_attr_string = SubAffiliate
  </code></pre>