Search sucks! Yeah, it does, and here's why.
julian @julian@community.nodebb.org
<p>You might've heard that search sucks on software X... maybe software Y... definitely on software Z. The default one kind of sucks on NodeBB too, admittedly.</p> <p>But why? It's because search is really frickin' hard to get right, and expensive to get good at.</p> <p>Remember that Google started as a search company, and they became king because they got really good at it, and <em>it was their only product</em> (at the time, anyway!)</p> <p>The easiest type of search is "full text" search. It matches words exactly based on what you type in. For example if you search <code>lemmy</code> it would match posts that include the word <code>lemmy</code> but depending on how the content was indexed, might not match <code>lemmy.world</code>, <code>lemmy.ca</code>, <code>lemmyverse</code>, etc.</p> <p>From there you start adding complexity like supporting <code>AND</code> and <code>OR</code>. You support partial matches (<code>lem</code> returns posts containing <code>lemmy</code> and <code>lemmings</code>).</p> <p>Add more logic to remove stop words and articles like <code>a</code>, <code>the</code>, etc.</p> <p>Put in some sorting logic to rank stuff higher (what's your algo? Recency? Votes? etc.)</p> <p>That's just the tip of the iceberg... this problem domain is so vast that entire companies have been built around just providing searching as a service (e.g. Algolia), and it isn't cheap!</p>
Read more →