# Best search facility

**URL:** <https://www.ruby-forum.com/t/best-search-facility/182196>\
**Category:** Rails\
**Created:** [January 24, 2010, 11:34pm UTC](https://www.ruby-forum.com/t/best-search-facility/182196 "2010-01-24T23:34:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [January 24, 2010, 11:34pm UTC](https://www.ruby-forum.com/t/best-search-facility/182196/1 "2010-01-24T23:34:53Z")

</div>

Hi All,

this may over-lap with my recent ferret post, but I wondered if anyone  
knew of the best way to add a search engine for rails on your site?

I’ve tried ferret, which seems a bit ‘‘hit n miss’’

Someone has also reccomeded paperclip.

In addition to this, where would I look to find the ability to add a  
google contacts search facility? So - anyone can enter their account  
and find people on my site who are also on gmail? Face book have this,  
but dunno how it’s implemented, or where to start looking…

Any help appreciated as always

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [January 25, 2010, 12:29am UTC](https://www.ruby-forum.com/t/best-search-facility/182196/2 "2010-01-25T00:29:53Z")

</div>

Solr is a better alternative in my experience. I’ve used  
acts\_as\_solr.

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [January 25, 2010, 9:20am UTC](https://www.ruby-forum.com/t/best-search-facility/182196/3 "2010-01-25T09:20:42Z")

</div>

On Jan 24, 2010, at 2:33 PM, RubyonRails\_newbie wrote:

> Hi All,
> 
> this may over-lap with my recent ferret post, but I wondered if anyone  
> knew of the best way to add a search engine for rails on your site?
> 
> I’ve tried ferret, which seems a bit ‘‘hit n miss’’

They all seem a bit “hit n miss”. That’s probably because they respond  
best with large databases and you are probably working with a test  
database. The three candidates I’ve used are:

- Sphinx
- Solr
- Ferret

From my perspective, the best choice is the one that provides the most  
pleasing results for you. Sphinx does very quick indexing, but not in  
real time (i.e., as the row is inserted).

> Someone has also reccomeded paperclip.

Paperclip is for adding attachments to existing models “as if” they were  
just another column in the database. Storage of the attachment can be in  
your filesystem, or Amazon S3, or pretty much anywhere else in the  
cloud. You provide the implementation for the “anywhere else” part.

> In addition to this, where would I look to find the ability to add a  
> google contacts search facility? So - anyone can enter their account  
> and find people on my site who are also on gmail? Face book have this,  
> but dunno how it’s implemented, or where to start looking…

Start here: [Contacts API Migration Guide &nbsp;|&nbsp; People API &nbsp;|&nbsp; Google for Developers](http://code.google.com/apis/contacts/). Then look here:  
[GitHub - mislav/contacts: Ruby library for consuming Google, Yahoo!, Flickr and Windows Live contact APIs](http://github.com/mislav/contacts).

Good luck!

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [January 25, 2010, 2:29pm UTC](https://www.ruby-forum.com/t/best-search-facility/182196/4 "2010-01-25T14:29:12Z")

</div>

On 24 Jan 2010, at 23:49, steve ross wrote:

> - Sphinx
> - Solr
> - Ferret

We use Solr for all but one of our applications, using a custom  
developed plugin (based on thinking sphinx), working like a charm on  
our databases that need realtime indexing without delta indexes.  
Ferret corrupted very often, Sphinx has the realtime problem.

Another option might be to look into MongoDB as a database, has some  
pretty nifty indexing features too. Requires a bit of a different  
mindset than normal relational databases though and might not be  
suited for every project.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [January 25, 2010, 2:04pm UTC](https://www.ruby-forum.com/t/best-search-facility/182196/5 "2010-01-25T14:04:01Z")

</div>

Cheers all,

I will dig into this now.

Appreciate ther feedback…

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [January 25, 2010, 3:54pm UTC](https://www.ruby-forum.com/t/best-search-facility/182196/6 "2010-01-25T15:54:52Z")

</div>

Here’s a tutorial I created for embedding google’s search engine for  
in-site searching only.

[http://www.ruby-forum.com/topic/201324](http://www.ruby-forum.com/topic/201324)

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [January 25, 2010, 8:56pm UTC](https://www.ruby-forum.com/t/best-search-facility/182196/7 "2010-01-25T20:56:48Z")

</div>

Hi, about the search, take a look at acts\_as\_solr\_reloaded:

> **[GitHub - dcrec1/acts\_as\_solr\_reloaded: ActsAsSolr with new features](https://github.com/dcrec1/acts_as_solr_reloaded)**
>
> ActsAsSolr with new features. Contribute to dcrec1/acts\_as\_solr\_reloaded development by creating an account on GitHub.

Here it’s explained and there is a demo video:

[http://www.diegocarrion.com/2010/01/18/thinkingsphinx-exits-enters-actsassolrreloaded/](http://www.diegocarrion.com/2010/01/18/thinkingsphinx-exits-enters-actsassolrreloaded/)

About the contacts, take a look at this plugin:

> **[GitHub - dcrec1/contacts\_rails: Google, Yahoo and Live Contacts in your Rails...](https://github.com/dcrec1/contacts_rails)**
>
> Google, Yahoo and Live Contacts in your Rails application with only a line of code - GitHub - dcrec1/contacts\_rails: Google, Yahoo and Live Contacts in your Rails application with only a line of code

Hope that helps 🙂

On Jan 24, 8:33 pm, RubyonRails\_newbie [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
