I'm trying to order the Thinking Sphinx search results for a model Item (real-time index) by an attribute on an associated object, Document:
@items = Item.search(
'jitters',
sql: {
left_joins: :document,
order: 'documents.published_at DESC, items.created_at DESC'
}
)
This works correctly when there are results.
However, when Thinking Sphinx finds no results, it returns <NoMethodError: undefined method 'any?' for nil:NilClass>.
I would expect it to return the usual 'Nothing found result.
Does anyone know the correct way to make this query? Or have I found a bug?