简体   繁体   中英

How to implement search layer for Ruby on Rails site?

We are implementing a product review site using Ruby on Rails.

Search is a core component of the user experience. We need to make searches fast and relevant.

Should we use Lucene or another open source search layer? Should we use Google's search API and index against only our site? Or should we develop proprietary search functionality?

Thanks!

I personally like Sphinx + UltraSphinx, but I'm sure there are an equal number of people who'd like Lucene or XXX. I'm afraid it depends on information not contained in your question. What are you searching? Does it have any form of taxonomy? What terms are users going to be searching for?

Ultrasphinx + Sphinx takes about 10 minutes to get running so I'd suggest you give it a crack and see how you get on.

Take a look at Solr. It's the fastest way to get up and running with a Lucene-powered search server. It'll provide additional features like faceting and plumbing for document pre-processing when indexing.

Solr also provides a lot of room for scaling as your site grows via both sharding & replication.

There seems to be plenty of bindings for Ruby (I'm more of a PHP guy so I can comment on their usefulness). Solr exposes a rich REST API you could leverage easily too.

One thing to consider carefully with Solr is how to deal with search index updates. Batch vs near real-time index updates may affect your strategy. You'll want to define your app's requirements in this regard ahead of time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM