News for hackers. Stuff that matters.
Re:Implementing faceted search with Django and PostgreSQL by simonw on Thursday October 05, 2017 @12:57PM (#15410674)
I've been working mostly with Elasticsearch for the past couple of years, but I have to admit I'm deeply impressed with the results I got out of PostgreSQL after only a few hours of hacking. Elasticsearch is far more flexible and powerful but for smaller, simpler search projects it's hard to beat the convenience of having everything built into the database.
Re:Implementing faceted search with Django and PostgreSQL by dsc_ on Thursday October 05, 2017 @06:26PM (#15413031)
Have you heard of ZomboDB? It aims to provide the best of both worlds; transactions and elasticsearch. I've been using it on my own pet project and am very happy that I only have to care about dealing with Postgres (the ES part goes automatically).
Re:Implementing faceted search with Django and PostgreSQL by aldoushuxley001 on Thursday October 05, 2017 @02:04PM (#15411187)
What do you find are the tradeoffs vs. working with Elasticsearch or Solr?

But great job, I've bookmarked your post to come back to and I'll give it a shot for sure. Definitely very enticing.

Re:Implementing faceted search with Django and PostgreSQL by simonw on Thursday October 05, 2017 @02:20PM (#15411356)
Elasticsearch is massively more powerful and flexible.

The way I'm doing aggregation counts on top of PostgreSQL is very unlikely to scale to millions of documents. Elasticsearch pretty much acts as a real-time, horizontally scalable map/reduce engine so expensive aggregations get executed on multiple shards and the results are gathered back together.

You may find my talk from DjangoCon this year interesting: https://speakerdeck.com/simon/the-denormalized-query-engine-... / https://www.youtube.com/watch?v=NzcvewgqYog

Re:Implementing faceted search with Django and PostgreSQL by StavrosK on Thursday October 05, 2017 @09:34PM (#15413842)
What type of data is ES good for? It's more than documents and full-text search, if I'm not mistaken, correct?
Re:Implementing faceted search with Django and PostgreSQL by bebop on Thursday October 05, 2017 @10:51PM (#15414105)
I have used it as a general data store, where I can accept eventual consistency. It is a very good distributed db if you are ok with the trade offs it imposes, mostly non-atomic commits to your cluster.
Re:Implementing faceted search with Django and PostgreSQL by othersideofcoin on Thursday October 05, 2017 @11:04PM (#15414148)
It also excels at storing logs for later aggregation and analysis.
Re:Implementing faceted search with Django and PostgreSQL by StavrosK on Friday October 06, 2017 @06:40AM (#15415718)
Thank you, I was specifically wondering how good it is at data ingestion for warehousing. Good to know that's one of its strengths.
Re:Implementing faceted search with Django and PostgreSQL by gt565k on Thursday October 05, 2017 @02:24PM (#15411393)
Generally speaking, you wouldn't want to run queries like this against the system of record (your database) in large applications where there are a lot of user queries, as that will impact performance.

Hence why solutions like elasticsearch and apache solr exist. They scale very well horizontally, allowing you to spread the load between multiple nodes.

Again, this comes down to what your use case is. If you have a tiny app with a relatively small number of users, using postgres for this functionality is probably ok.

Re:Implementing faceted search with Django and PostgreSQL by zitterbewegung on Thursday October 05, 2017 @01:38PM (#15410952)
I think this looks like a great tutorial but why is all the text in a small column oriented to the left?
Re:Implementing faceted search with Django and PostgreSQL by simonw on Thursday October 05, 2017 @01:49PM (#15411038)
Because I’m still using the site design I came up with in ~2007!

I’m hoping to find time soon to modernize it for 2017 era screen size at some point soon. I did at least manage to get some media queries in there so it’s readable on mobile phones.

Re:Implementing faceted search with Django and PostgreSQL by randlet on Thursday October 05, 2017 @10:14PM (#15413974)
Adding #wrapper {margin: auto} centres it and makes it look better IMO. Great article!
Re:Implementing faceted search with Django and PostgreSQL by simonw on Thursday October 05, 2017 @02:10PM (#15411262)
Bumped everything up to be a bit wider - thanks for the feedback.
Re:Implementing faceted search with Django and PostgreSQL by zitterbewegung on Thursday October 05, 2017 @03:20PM (#15411851)
If you just center it it would be perfect actually because it would be very readable.