TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

9 点作者 xkbd将近 7 年前

15 条评论

ctvo将近 7 年前
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 未加载
tedmiston将近 7 年前
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 未加载
jakelazaroff将近 7 年前
Is this for work, and is search a competitive advantage for you? If not, snap in Elasticsearch and spend your time on your differentiators.
dewey将近 7 年前
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 未加载
33degrees将近 7 年前
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 未加载
mikece将近 7 年前
Have you written a search engine from scratch before? There&#x27;s a reason this is still a primary field for PhD work.
smilesnd将近 7 年前
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.
mlevental将近 7 年前
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 未加载
anonfunction将近 7 年前
To leverage the thousands of hours that went into it.
based2将近 7 年前
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>
wallflower将近 7 年前
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>
ian1321将近 7 年前
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 未加载
xellisx将近 7 年前
Sphinx is another full text search engine.
hiroshi3110将近 7 年前
How about implementing a search engine on top of key-value store like FoundationDB?
courtneycouch0将近 7 年前
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.