Search code examples
ruby-on-railsrubyelasticsearchsolrelasticsearch-rails

why we use search engine like solr,elastic search or any other search engine instead we have active record gems like ransack


why we use search engine like solr,elastic search or any other search engines instead we have active record gems like ransack,meta_search etc.

I am new in search engines selection.

I know the indexing behaviour and others are available for search engines. but want to know what performance wise or large data wise search engines help.

I am creating a shoping site and I am in a confusion what should I do ?

Any help will be remarkable for me


Solution

  • You can't compare these things so easily. Ransack is "just" a gem which handles a full text search in your database for you. It creates a SQL query for every search request. This can slow down your application if it has a big scale since the application has to do other things as well.

    Elasticsearch is a search server written in Java. It does nothing other than searching through it's internal database. It's optimised for it. And of course it also has advanced algorithms which bring you the google-feeling like Did you mean ... and so on.

    For more information take a look into the 10 minute walk through of Elastic.

    I would recommend you if it's just a shopping site and it isn't expected to get the size of Amazon then go with Ransack for now. You can still change later.