Over the last two years, I’ve had the pleasure of doing and re-doing our search at work 4 times. Search and information retrieval is a deep and complex field. Nevertheless, I feel like it should be easy to add a simple search to a rails website.
I recently discovered that Django already solved this problem. Thus, Rails can do it too and even improve upon it.
Similar to a lot of Rails source, we already have something working in production @ Ollie Order. However, it can be a lot better if it was deeply integrated into rails. The recent changes that @eileencodes made to support multiple database can be key to paving support for more advanced search solution like ElasticSearch, Algolia, etc. Baking a lot of things right into ActiveRecord would be ideal.
For the first version, I’d like to focus on keeping it simple using a single database for data & searching. Most databases these days support some form of full-text search. Similar to ActiveRecord it will support the ability to use any search engine you want. Unlike ActiveRecord, it will allow users to choose the search engine per view. Different views of the same data need different search capabilities and performance (e.g. /admin/posts vs /posts will get different traffic).
More details here: [proposal] ActiveSearch - Rails Search · Issue #40989 · rails/rails · GitHub
- I’ll be putting together all these gems in a repo and a rails guide document to experiment with what this new API might look like.
Looking to hear how others approach & solve this problem in Rails. I’m also looking for a few individuals who are equally passionate and want to help solve this problem.