Forum: Ruby on Rails Best way and practices to implement search

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Gu s. (Guest)
on 2009-01-20 06:21
I'm trying to implement a search engine to look thru some stuff in my
models. Is there a way I can do something similar to Model.find, but
that is more "forgiving" (poor spelling etc.) and also leverages the
relationships that I've specified (so that it also searches has_many or
belongs_to models)?

Do you have any suggestions on how to implement this. Are there any good
plugins or do I have to write it by myself?

Thanks!
Sheldon Finlay (Guest)
on 2009-01-20 07:17
(Received via mailing list)
Thinking Sphinx seems to be way to go for a configurable real text
search engine. Here's a railscasts.com screencast with links:

http://railscasts.com/episodes/120-thinking-sphinx

Sheldon Finlay
Phlip (Guest)
on 2009-01-20 07:32
(Received via mailing list)
Sheldon Finlay wrote:
> Thinking Sphinx seems to be way to go for a configurable real text
> search engine. Here's a railscasts.com screencast with links:
>
> http://railscasts.com/episodes/120-thinking-sphinx

I liked Sphinx, and wrote it up, but it has turned out to be a real itch
to
maintain.

Sphinx requires its own daemon running in another process. That makes
unit tests
extremely difficult to keep clean. They must configure data, start the
daemon,
run it reliably, and stop it on command.

This is silly in modern Web architecture, because Mongrel (or mod-rails,
or
Passenger) already are daemons, so a search system could simply ride
around
inside your Ruby vm as a @@class_instance of some controller. Its index
would
persist in memory long enough to be efficient at search time - that is
the point
of a persistent daemon process.

I intend to look at SearchLogic as soon as possible - formerly
"Searchgasm" - to
see if it's lighter than Sphinx. Over time, all of our Sphinx unit tests
have
"decayed". They would fail for no reason, out of the blue, on the test
server,
when we were busy working on something else, and we would comment them
out.
Almost none are still online, and that is a very bad omen.

Sphinx's authors could simply provide an in-memory version...

--
   Phlip
This topic is locked and can not be replied to.