One way to get what I want:
define_index do
indexes title
...
indexes "IF(ISNULL(owner_id),'nobody',concat_ws(' ',
users.first_name, users.last_name))", :as => :owner_or_nil
end
But this seems very nasty, is there a more elegant approach?
On Sep 8, 12:18 pm, Greg <[email protected]> wrote:
> Is it possible to search for all fields that have a null value?
>
> eg:
>
> define_index do
> indexes title
> ...
> indexes [owner(:first_name), owner(:last_name)], :as
> => :owner_name
>
> set_property :delta => true
> end
>
> I can search like "@owner_name John Doe" and get all items owned by
> John Doe, but I also need to have a search that returns all unowned
> items, eg "@owner_name nil" is this possible?
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---