search API question

3 views
Skip to first unread message

Francis Hwang

unread,
Nov 15, 2009, 9:46:15 AM11/15/09
to admin_a...@googlegroups.com
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/



John Quarto-vonTivadar

unread,
Nov 15, 2009, 11:10:51 AM11/15/09
to admin_a...@googlegroups.com, admin_a...@googlegroups.com
Search_by_default ? Or what about just search , that happens to
have default values? The simplicity of the search form implies to the
user simplicity of search results, at least as to the URI of the results

Sent from my iPhone
> --
>
> You received this message because you are subscribed to the Google
> Groups "admin_assistant" group.
> To post to this group, send email to admin_a...@googlegroups.com.
> To unsubscribe from this group, send email to admin_assista...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/admin_assistant?hl=
> .
>
>

Luke Melia

unread,
Nov 15, 2009, 2:25:18 PM11/15/09
to admin_a...@googlegroups.com
How about default_search_matches_on

Something else this brings to mind is pluggable search
implementations. i.e. Search via DB is not always a viable option for
large datasets. What if you could provide some code to search via
sphinx or solr or whatever you like?

Luke



--
From the iPhone of Luke Melia | http://www.lukemelia.com |
917-770-9196 (m)

Francis Hwang

unread,
Nov 15, 2009, 8:58:04 PM11/15/09
to admin_a...@googlegroups.com
On Nov 15, 2009, at 2:25 PM, Luke Melia wrote:

> Something else this brings to mind is pluggable search
> implementations. i.e. Search via DB is not always a viable option for
> large datasets. What if you could provide some code to search via
> sphinx or solr or whatever you like?

I'm not opposed to it, though I suspect getting the right interface
would be non-trivial since the methods of lookup are so different. If
anybody wants to implement this (and has specific use-cases in mind)
I'm happy to try to help out in whatever way.

Francis Hwang
http://fhwang.net/

Reply all
Reply to author
Forward
0 new messages