DEV Community

Cover image for Getting Started with Elasticsearch and Ruby

Getting Started with Elasticsearch and Ruby

Molly Struve (she/her) on March 03, 2020

Recently, DEV has started the migration from Algolia to Elasticsearch. Since I am often asked what is the best way to get started with Elasticsearc...
Collapse
 
artoodeeto profile image
aRtoo

Nice article ma'am awesome as always. Question though. So after getting the results, you will still have to query in your own database so you can get the full information needed? like the comments of the posts, the owner, users who liked, and some metadata? thank you again. :)

Collapse
 
molly profile image
Molly Struve (she/her)

If you want other data associated with tags then yes. Or you store some of that data in Elasticsearch in another index and fetch it that way.

Collapse
 
storrence88 profile image
Steven Torrence

Hey, Molly! Thanks for writing such a great article/walkthrough. I saw there are gems that act as a wrapper for elastic search like Searchkick.

How do things like that differ from the implementation youโ€™ve shown above? Are there performance benefits to doing it either way?

Collapse
 
molly profile image
Molly Struve (she/her)

The benefit of using the plain ruby wrapper is that you have much more control over what and how you are searching. The more you abstract the Elasticsearch interactions away like with Searchkick the less control you have. The trade-off is that it can be very easy to get up and running quickly with minimal understanding of Elasticsearch itself.

Collapse
 
storrence88 profile image
Steven Torrence

I see. Makes total sense. Thanks for the quick reply!

Collapse
 
thejoezack profile image
Joe Zack

Yay for Elasticsearch! We run with docker locally and it makes life easier for us, especially for upgrades and it's nice to be able to wipe our volumes to start with a clean slate.

Great write up, as always!

Collapse
 
anquegi_91 profile image
Antonio Juan Querol

Gracias!! for this great tutorial, only one point for the part of installing the elasticsearch iI want to suggest to use testcontainers ruby github.com/testcontainers/testcont...

Collapse
 
corymcdonald profile image
Cory McDonald

Thank you so much for writing this! I'm leveraging a lot of what Forem is doing for Brave's creators site. Plus the docs written in the repo are great. ๐Ÿ˜„

Collapse
 
qdequele profile image
Quentin de Quelen

Hi Molly! Thanks for this article. I would like to know what made you decide to switch from Algolia to Elastic? Is that the price? Or just because you love Elastic in general?

Collapse
 
molly profile image
Molly Struve (she/her)
  • Price
  • More control over creating indexes and queries
  • Elasticsearch is open-source which makes it accessible to everyone and contributes to our efforts in making the DEV platform completely open-source
Collapse
 
qdequele profile image
Quentin de Quelen

Cool! As expected. I was wondering because I'm kind of in the business.

I'm working on an Algolia open-source alternative. It's free, self-hosted and built-in user-facing search. I'm putting the link here just in case. github.com/meilisearch/meilisearch

Thread Thread
 
rhymes profile image
rhymes

Interesting! A FTS engine in Rust! Starred :)