Reputation: 35379
I have a small site with about 500 photos and 150 visitors per day which is hosted on Dreamhost. I would like to add a simple search engine that does not need to run long time processes which are not allowed on shared host.
The search engine should process different fields belonging to various models: Photo, Photo.author.name, Photo.comments.content and many others
Is there any plugin that can help?
Upvotes: 4
Views: 2919
Reputation: 16769
I think that the acts_as_indexed plugin is the best bet for your needs. It doesn't require a separate server; it creates its index automatically in the filesystem. On a site similar to yours, it was plenty fast and easy to configure.
Upvotes: 2
Reputation: 176352
There are at least 3 full-text search engines for Rails:
Which one is the best choice? It depends. Here you can read a comparison between sphinx and ferret, including a comment from Engine Yard.
Upvotes: 3
Reputation: 2008
Ferret or sphinx WILL need dedicated background process. Your only option seems like mysql full text search with proper indexes.
Upvotes: 1
Reputation: 7154
You might want to look into Sphinx/Thinking Sphinx for fast full-text search.
I don't know if installing Unix packages and that whole process is overkill for what you're looking for on Dreamhost, but it's a very fast and robust solution that will serve your needs well in the future.
Upvotes: 0
Reputation: 211540
The full-text search feature of MySQL, which is generally available on any shared hosting environment, is a great way to add this kind of functionality. The only downside is that it works only on MyISAM tables which have generally been deprecated in favor of InnoDB.
The approach that I have seen work, where a great example is the Wikipedia database architecture, is to create derivative copies of model records specifically for searching purposes. These need to be kept in sync with the main record, but that's easily done with an after_save handler or a simple SQL update statement.
One note is that ActiveRecord is not capable of understanding full-text indexes. A rather ugly extension is required to make it cooperate, though I do have an example bundled up in a collection of MySQL hacks:
http://github.com/theworkinggroup/rails_mysql_hacks/tree/master
Upvotes: 4
Reputation: 42893
acts_as_ferret
will most likely serve you well.
But I don't know if and how Ferret will perform on a setup like yours.
Upvotes: 1