Live data from Hacker News

Thoughts on Algolia vs. Solr and Elasticsearch

opensourceconnections.com

21–30 of 33 posts

Re: Thoughts on Algolia vs. Solr and Elasticsearch

#21
I recently had to build a product search functionality. I was able to pick up nearly all important features of Elasticsearch in about 2 days and had live-indexing and search up and running within 2 more days. Of course, this wasn't production level scalable code. But it was fairly easy to hook a Logical Decoding Output Plugin on Postgres, which would stream database mutations (in form of JSON) to a Kafka cluster, from where the Elasticsearch layer will ingest the data and index/update it appropriately.

Re: Thoughts on Algolia vs. Solr and Elasticsearch

#22

I recently had to build a product search functionality. I was able to pick up nearly all important features of Elasticsearch in about 2 days and had live-indexing and search up and running within 2 more days. Of course, this wasn't production level scalable code. But it was fairly easy to hook a Logical Decoding Output Plugin on Postgres, which would stream database mutations (in form of JSON) to a Kafka cluster, fro…

what logical decoder?

Re: Thoughts on Algolia vs. Solr and Elasticsearch

#23

I recently had to build a product search functionality. I was able to pick up nearly all important features of Elasticsearch in about 2 days and had live-indexing and search up and running within 2 more days. Of course, this wasn't production level scalable code. But it was fairly easy to hook a Logical Decoding Output Plugin on Postgres, which would stream database mutations (in form of JSON) to a Kafka cluster, fro…

what logical decoder?

Postgres 9.4+ lets you use the write-ahead log and "replication slots" using which you can create streams of database changes that can be replayed to a client in the order they were made on the origin server [1]

EDIT: In case the question was which library did I use, I used BottledWater and it's worked great for me so far [2]

[1] https://www.postgresql.org/docs/9.4/static/logicaldecoding-e...

[2] https://github.com/confluentinc/bottledwater-pg

Re: Thoughts on Algolia vs. Solr and Elasticsearch

#24
post #8

Earlier quoted context omitted.

Haven't tried the others, but Product Hunt's search is also extremely poor. Just today I searched for "mac voice control" (unquoted) and besides being very sluggish because of all the refreshing it does while I type, it returned 0 results . What I was looking for was Lacona [1] which was just featured a couple days ago and has a description containing two of the words from my query (1/3 of the description!). [1] http…

This is actually a great example that shows where Algolia doesn't shine. Algolia is great a known-item searches. Searches that are like looking up a contact in your phone list. This is a common use case with search, but one of only many. Your use case is closer to grasping at straws because you don't know the language to use. You can't quite remember the name for something. This is also very common, and not handled w…

Algolia contains a lot of customization parameters that can be used. For example the Product Hunt example could have been solve easily by using removeWordsIfNoResults=allOptional (query is trying as a AND and if there is no results, it is tried again as a OR)

Re: Thoughts on Algolia vs. Solr and Elasticsearch

#25
post #8
post #7

Earlier quoted context omitted.

For me Medium, Product Hunt, Digital Ocean or even Twitch are not "toy sites".

Haven't tried the others, but Product Hunt's search is also extremely poor. Just today I searched for "mac voice control" (unquoted) and besides being very sluggish because of all the refreshing it does while I type, it returned 0 results . What I was looking for was Lacona [1] which was just featured a couple days ago and has a description containing two of the words from my query (1/3 of the description!). [1] http…

This result is indeed not good but it could be solved easily with one Algolia setting (removeWordsIfNoResult=allOptional which perform the query with all terms as mandatory and reply it with optional terms if there is no result).

Algolia comes with a lot of pre-defined tuning that are good for most use cases (see https://blog.algolia.com/inside-the-algolia-engine-part-3-qu... for more details).

That said there is always some tuning to have perfect result for a specific use case. There is no engine that provide perfect results out of the box without any tuning.

Re: Thoughts on Algolia vs. Solr and Elasticsearch

#26
post #4

In my experience, Algolia is OK for toy sites but not for anything even moderately complex. Even on HN it's often a challenge to find the right results. They seem to have gone with the philosophy that speed is more important than relevance. Keyword matching is only one small aspect of a good search experience.

We actually have pretty complex implementation done with Algolia. Like a grocery store where relevance depends of the history of each user.

As with any engine, there is a lot of customization possible to handle complex use cases and it won't be handled out of the box.

You can read this list of 10 tips to have a great relevance, all of them are doable with Algolia: https://blog.algolia.com/algolias-top-10-tips-to-achieve-gre...

Re: Thoughts on Algolia vs. Solr and Elasticsearch

#27

Why would one use Algolia over Postgres's built in text search features? Ex: http://rachbelaid.com/postgres-full-text-search-is-good-enou... I already have Postgres search queries running on the order of 1-3ms for large queries, basically faster than Algolia, with seemingly the same feature sets. I don't understand the value proposition over something like Postgres, for sites that already have Postgres databases. (An…

If Postgres works for you then great, but it doesn't really compare to Solr/Elasticsearch. I haven't used Algolia so I cannot comment on it. Postgres is hard to use beyond very basic keyword searching and it doesn't support many standard features such as phrase search.

Re: Thoughts on Algolia vs. Solr and Elasticsearch

#28

Why would one use Algolia over Postgres's built in text search features? Ex: http://rachbelaid.com/postgres-full-text-search-is-good-enou... I already have Postgres search queries running on the order of 1-3ms for large queries, basically faster than Algolia, with seemingly the same feature sets. I don't understand the value proposition over something like Postgres, for sites that already have Postgres databases. (An…

> Why would one use Algolia over Postgres's built in text search features? Ex: http://rachbelaid.com/postgres-full-text-search-is-good-enou... . Postgres built-in search features are really for large document searching -- we've tried using it for indexing e.g. an array of tags for auto-complete and the search times were in the ~500ms+ range, as a matter of fact the non-indexed regex search was only slightly slower. I…

I would recommend to read this post to have an idea: https://blog.algolia.com/inside-the-algolia-engine-part-3-qu...

Textual relevance is a very complex domain and the Postgres's built in text search features is a simple keyword matching engine compared to Algolia engine that contains a lot of alternative matching. The mesure of textual relevance is also very different of what you have in the Postgres text search.

At the end, this is not only about speed but mainly about relevance

Re: Thoughts on Algolia vs. Solr and Elasticsearch

#29
post #8

Earlier quoted context omitted.

Haven't tried the others, but Product Hunt's search is also extremely poor. Just today I searched for "mac voice control" (unquoted) and besides being very sluggish because of all the refreshing it does while I type, it returned 0 results . What I was looking for was Lacona [1] which was just featured a couple days ago and has a description containing two of the words from my query (1/3 of the description!). [1] http…

This result is indeed not good but it could be solved easily with one Algolia setting (removeWordsIfNoResult=allOptional which perform the query with all terms as mandatory and reply it with optional terms if there is no result). Algolia comes with a lot of pre-defined tuning that are good for most use cases (see https://blog.algolia.com/inside-the-algolia-engine-part-3-qu... for more details). That said there is alw…

True though this assumes these direct words are mentioned in the text (assuming know synonyms). Algolia has basic synonym functionality but ES gives you a lot more power here.

Further the more words you remove, the less constrained the results get possibly creating a lot of noise. Though I assume you remove based on document frequency, which helps.

This would be a problem with this strategy regardless of search engine (ES or Algolia)

Re: Thoughts on Algolia vs. Solr and Elasticsearch

#30

Earlier quoted context omitted.

This result is indeed not good but it could be solved easily with one Algolia setting (removeWordsIfNoResult=allOptional which perform the query with all terms as mandatory and reply it with optional terms if there is no result). Algolia comes with a lot of pre-defined tuning that are good for most use cases (see https://blog.algolia.com/inside-the-algolia-engine-part-3-qu... for more details). That said there is alw…

True though this assumes these direct words are mentioned in the text (assuming know synonyms). Algolia has basic synonym functionality but ES gives you a lot more power here. Further the more words you remove, the less constrained the results get possibly creating a lot of noise. Though I assume you remove based on document frequency, which helps. This would be a problem with this strategy regardless of search engin…

Algolia has actually a very decent synonyms support:

  * mono & multi-words synonyms,

  * typo-tolerance is compliant with synonyms,

  * matching synonyms are highlighted,

  * prefix search works also on synonyms (even on multi words).
A v2 of the synonyms API will be released in the next few days including:

  * dedicated API endpoints (leveraging existing synonyms but also Algolia's "alternative corrections" and "placeholders")

  * new edition UI (with search & filtering capabilities)

  * one/bi direction synonyms
Post reply on HN