I've been having a problem with Thinking Sphinx's query generation. I would input a query like '"jack | "the bean stalk" | jill | jeffrey", and instead of the expected fast index loop, I get the slow SQL query:
SELECT table.id, table.FullName FROM
tableWHERE (LOWER(table.FullName) LIKE '%jack or \"the bean stalk\" or jill or jeffrey%') ORDER BY table.FullName ASC LIMIT 10
This query is strange for a number of reasons. First, instead of a boolean lookup, I get a wildcard lookup of a misceginated version of the query. Second, it is searching ordered by FullName, when I requested some other field to order by (LastName).
I know that Thinking Sphinx will bypass its index and drop into native SQL queries when sorting against a column that was not specified :sortable => true, and it will do so on columns that are not strings. However neither is the case here.
Why is it dropping into native SQL?