TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Why should I use Elasticsearch instead of building from scratch

9 pointsby xkbdalmost 7 years ago

15 comments

ctvoalmost 7 years ago
When did this place become such a low effort brain dump? I can&#x27;t believe I&#x27;m so annoyed by this question. Google. Make some educated trade-off decisions based on your context.<p>Use HN to poll for opinions and experiences from others, not for things that take 30 minutes to resolve.
评论 #17278234 未加载
评论 #17278164 未加载
tedmistonalmost 7 years ago
You should write one from scratch to get a deeper understanding of how hard it is to return highly relevant results quickly. Tokenizing, stemming, bag of words, and tf-idf for ranking get you to an MVP, but then you realize how good production grade search engines are today.<p>Solr is good. I&#x27;ve been wanting to try Lunr [1] for small sites.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;olivernn&#x2F;lunr.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;olivernn&#x2F;lunr.js</a>
评论 #17278086 未加载
jakelazaroffalmost 7 years ago
Is this for work, and is search a competitive advantage for you? If not, snap in Elasticsearch and spend your time on your differentiators.
deweyalmost 7 years ago
With that little information from the OP the answer is probably: Use ES or if it&#x27;s a small side project use your DB&#x27;s included full text search if it&#x27;s good enough.
评论 #17278013 未加载
评论 #17278049 未加载
33degreesalmost 7 years ago
Elasticsearch is incredibly deep, and highly performant. If all you need is simple full text search then rolling your own can be an interesting exercise, but I can&#x27;t imagine the amount of hours it would take to replicate the features I use on a daily basis.
评论 #17279491 未加载
mikecealmost 7 years ago
Have you written a search engine from scratch before? There&#x27;s a reason this is still a primary field for PhD work.
smilesndalmost 7 years ago
The simple answer is because Elasticsearch has had thousand of hours already put into writing its code base. The real question should be why shouldn&#x27;t you use Elasticsearch? Is the code base to large to fit where you need it to be? Will it be able to scale with your project? Is it efficient enough for your requirements? When looking to use a piece of technology the requirements and long term effects are what matter. Roll your own if that is what is required for you to reach your end goal.
mleventalalmost 7 years ago
what a weird question: who looks at a search engine and thinks yea hm that&#x27;s trivial enough i could do it myself in a weekend?
评论 #17278030 未加载
anonfunctionalmost 7 years ago
To leverage the thousands of hours that went into it.
based2almost 7 years ago
What do you want ?<p><a href="https:&#x2F;&#x2F;db-engines.com&#x2F;en&#x2F;ranking" rel="nofollow">https:&#x2F;&#x2F;db-engines.com&#x2F;en&#x2F;ranking</a>
wallfloweralmost 7 years ago
Actually, the origin story of Elasticsearch started with Shay Banon attempting to build a cooking app for his wife who was a chef.<p>&gt; JAXenter: You started Compass, your first Lucene­-based technology, in 2004. Do you remember how and why you became interested in Lucene in the first place?<p>&gt; Shay Banon: Reminiscing on Compass birth always puts a smile on my face. Compass, and my involvement with Lucene, started by chance. At the time, I was a newlywed that just moved to London to support my wife with her dream of becoming a chef. I was unemployed, and desperately in need of a job, so I decided to play around with “new age” technologies in order to get my skills more up­to­date. Playing around with new technologies only works when you are actually trying to build something, so I decided to build an app that my wife could use to capture all the cooking knowledge she was gathering during her chef lessons.<p>&gt; I picked many different technologies for this cooking app, but at the core of it, in my mind, was a single search box where the cooking knowledge experience would start a single box where typing a concept, a thought, or an ingredient would start the path towards exploring what was possible.<p>&gt; This quickly led me to Lucene, which was the defacto search library available for Java at the time. I got immersed in it, and Compass was born out of the effort of trying to simplify using Lucene in your typical Java applications (conceptually, it simply started as a “Hibernate” (Java ORM library) for Lucene).<p>&gt; I got completely hooked with the project, and was working on it more than the cooking app itself, up to a point where it was taking most of my time. I decided to open source it a few months afterwards, and it immediately took off. Compass basically allowed users to easily map their domain model (the code that maps app&#x2F;business concepts in a typical program) to Lucene, easily index them, and then easily search them.<p>&gt; That freedom caused people to start to use Compass, and Lucene, in situations that were wonderfully unexpected. Imagine already having the model of a Trade in your financial app, one could easily index that Trade using Compass into Lucene, and then search for it. The freedom of searching across any aspect of a Trade allowed users to convey this freedom to their users, which proved to be an extremely powerful concept.<p>&gt; Effectively, this allowed me to be in the front seat of talking and working with actual users that were discovering, as was I, the amazing power that search can have when it comes to delivering business value to their users. Oh, and btw, my wife is still waiting for that cooking app. Now, 10 years later, it is the basis of Elasticsearch.<p><a href="https:&#x2F;&#x2F;jaxenter.com&#x2F;elasticsearch-founder-interview-112677.html" rel="nofollow">https:&#x2F;&#x2F;jaxenter.com&#x2F;elasticsearch-founder-interview-112677....</a>
ian1321almost 7 years ago
Tough to answer w&#x2F;o more info. FWIW, I&#x27;ve used Lucene, Solr, and Elasticsearch and have ended up settling on Lucene being the best interface for me.
评论 #17278062 未加载
xellisxalmost 7 years ago
Sphinx is another full text search engine.
hiroshi3110almost 7 years ago
How about implementing a search engine on top of key-value store like FoundationDB?
courtneycouch0almost 7 years ago
Definitely build it completely from scratch. You should roll your own TCP libraries as well. Don&#x27;t trust anything you didn&#x27;t write yourself. Come to think of it, I&#x27;m not sure you should rely on someone else&#x27;s hardware either.