Sphinx has no concept of searching for empty fields. I think a better option would be to add an attribute indicating whether the specific column is blank:
has "LENGTH(body) < 0", :as => :empty_body, :type => :boolean
That should work for MySQL - for PostgreSQL, I think the function is char_length.
And then in searches, you can do the following:
Article.search :with => {:empty_body => true}
Add another attribute for the title as well, and then you can use that filter.
Hope this helps.
--
Pat
> --
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
>
To unsubscribe from this group and stop receiving emails from it, send an email to thinking-sphi...@googlegroups.com.
Visit this group at https://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.