Meow?

Finding Meow 😺 — the cutest cat from each town using Elasticsearch

#cutest-cat-per-town

Shashank Sharma
Published in
5 min readMay 24, 2020

--

Cat fact: Meow is one of the most common names for a cat (for obvious reasons 😸).

While researching for this article, I realized there are plenty of people who love cats. There are numerous websites to suggest names for cats, see www.findcatnames.com for example. iknowwhereyourcatlives.com is an interesting data visualization experiment that locates a sample of one million public images of cats in the world. To be honest, this is a core reason I finalized on cats as an example for this article. 😉

Let’s get into understanding the problem statement itself:

Find the most cutest cat named Meow from each town.

In a town, there would be many cute cats. We have to pick only one cutest cat from each town, whose name is Meow.

This problem statement is an example of a typical greatest-n-per-group query (hence cutest-cat-per-town). Interestingly, this question comes up several times per week on StackOverflow. To be accurate, at the time of writing this article, there are 10,206 questions with the tag greatest-n-per-group and counting.

Let’s take a small dataset of cats with the columns id, cat name, town, and cuteness level ranging from 1 to 10, 10 being…

--

--

Shashank Sharma
Writer for

Programmer | Technology enthusiast | Building projects and teams