Autonomous Machine

A Brief Summary of 2 Mongoid Search Libraries

In the course of developing Forkchop, I've tried out a few of the Mongoid-compatible search plugins.

The goal of these libraries is to provide lightweight search functionality that precludes the need for a full search engine. And while most projects will graduate to something like Sphinx (or IndexTank or Lucene/Solr), it's nice to be able to start out with something simpler when a project's search needs are still basic.

Mongoid Search

This library is a better choice for searching the text of articles. It doesn't offer nearly as many options as Mongoid Fulltext Search, but its code is much shorter and extensible. I am currently using this library and paginating result sets with Kaminari.

Mongoid Fulltext Search

This project is best suited for providing autocomplete-type functionality. I tried to use it first, but ran into some problems trying to modify it's behavior (for example, there isn't an easy way to use an $any query instead of $all without overriding a large internal method).