0

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

Rajarshi Das
  • 11,778
  • 6
  • 46
  • 74

1 Answers1

9

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.

Tobias
  • 4,523
  • 2
  • 20
  • 40
  • but if data becom > 40 GB is it optimize the first search if we use search engine instead of gem? or be same I have to optimize other ways? – Rajarshi Das Nov 30 '15 at 11:01
  • So if your data exceeds 40GB than you should probably go with a search server like `Elasticsearch`. Except if you have images and videos included in your calculation. Because they are irrelevant for the search. But if it's really the data that you save in the database with more than 40GB then go with a search server and you are probably at the scale of Amazon's Database :). – Tobias Nov 30 '15 at 11:08