A simple full-text search implementation for Mongoid ORM, supporting partial and case-insensitive searches with customizable indexing.
Mongoid Search is a Ruby gem that adds full-text search capabilities to Mongoid-based applications. It works by automatically indexing specified fields into a keywords array within MongoDB documents, enabling fast, case-insensitive, and partial text searches without external dependencies. It's designed for small to medium datasets where simplicity and integration with Mongoid are key.
Ruby developers using Mongoid ORM with MongoDB who need basic full-text search functionality without the overhead of external search engines like Elasticsearch. Ideal for small to medium-sized applications where dataset size is manageable.
Developers choose Mongoid Search for its simplicity, seamless integration with Mongoid, and minimal configuration. Unlike heavier alternatives, it provides essential search features directly within MongoDB, reducing infrastructure complexity and setup time for smaller projects.
Simple full text search for Mongoid ORM
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically indexes specified fields into _keywords arrays on save with minimal code changes, as shown in the model examples where including Mongoid::Search adds search functionality instantly.
Supports partial matching, case-insensitive searches, and configurable match logic (:any or :all) via an initializer, allowing fine-tuning for different use cases without external dependencies.
Enables creating separate keyword indexes for different field sets within the same model, such as _unit_keywords, facilitating targeted searches without cluttering a single index.
Offers extensive initializer options for ignoring words, stemming, regex patterns, and more, providing control over search behavior, as demonstrated with config.ignore_list and config.stem_proc.
Explicitly not recommended for datasets over 1 million records, making it unsuitable for large-scale applications where performance degrades due to MongoDB array indexing constraints.
Regex search is noted to be slower in the README, and the reliance on manual reindexing via rake tasks means search updates aren't real-time, impacting responsiveness for dynamic data.
Lacks out-of-the-box support for advanced search capabilities like faceted search, stemming (without a custom proc), or natural language processing, requiring extra work for complex needs.