So, I'm trying to figure out a good way to satisfy Alex's use-case for
searching, but I thought I'd ping the group about the API. Basically,
Alex wants to be able to have one search field in the form, and have
it map to multiple columns in searching the DB. This might also
include fragments of SQL such as "concat_ws(' ', users.first_name,
users.last_name)", say, so somebody can search for "john doe" and
match the right user across two different fields.
Anyway, you can do most of this with default_search_includes, and I
could extend this to include SQL fragments:
index.search.default_search_includes :first_name, :last_name,
"concat_ws(' ', users.first_name, users.last_name)"
... only, the problem is the more I say "default_search_includes" in
my head the worse it sounds. "default_search_matches" is maybe a
little better but not by a lot.
Anybody else have thoughts for what this could be called?
Francis Hwang
http://fhwang.net/