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.

Adding search and autocomplete to a Rails app with Elasticsearch

14 pointsby grkover 11 years ago

2 comments

redox_over 11 years ago
Hey there,<p>Great post. 10 days ago, I&#x27;ve posted a link (<a href="https://news.ycombinator.com/item?id=6476003" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6476003</a>) demonstrating how I was able to crawl, index and plug auto-complete on HN posts in less than 2 hours using Algolia Search as a Service API (rails + JS client). The main differences between ES and Algolia for this use-case are about the way prefix matching is handled and the way highlighting is done.<p>To provide auto-completion (prefix matching), whereas ES use ngrams and tokenization tricks to index all word prefixes, Algolia&#x27;s data structures have a built-in feature enabling to match the prefixes of a word without doing such recipe at indexing time. As a consequence, your indexes will be smaller and your service faster :) Moreover, with Algolia, using such prefix matching algorithm provide outstanding highlighting capability. In fact, the index knows exactly which word matched (whereas ES knows that a specific &quot;fake&quot; ngram matched, but it&#x27;s complex to highlight the original words with it), even handling typos.<p>We compared ES and Algolia for a basic &quot;record&#x2F;database search&quot; use-case in our last blog post: blog.algolia.com&#x2F;full-text-search-in-your-database-algolia-versus-elasticsearch&#x2F;.<p>Feel free to contact me if you have any question.<p>Sylvain
hackerboosover 11 years ago
What are the benefits of searchkick over tire?
评论 #6532141 未加载