Improving your search results in Elasticsearch

Fish from the movie “Finding Dory” with the words “Finding stuff: principles of search” against a blue background
Fish from the movie “Finding Dory” with the words “Finding stuff: principles of search” against a blue background
Image credit: Author

Search is everywhere. How would you survive a day without it!? It’s on every website and part of every product. Whether you’re purchasing underwear, trawling Netflix for a Friday night movie, or even leading a cutting-edge research team, it can be a modern miracle to summon what you need at the cost of a few key presses.

Despite being ubiquitous, why is search so often terrible? It’s frequently seen as second class, a bonus. It is plugged in and expected to work out of the box. It takes time, thought, and effort to craft a well-balanced search experience.

Before We Begin

Talking about…

One of the cornerstones of great software development, do you remember what it stands for?

Encountered by most software developers in their early years on the job, the SOLID principles remain a key driver in all well-written software.

I hear it referenced often and frequently find myself using it in conversation, but realized — to my shame — that I couldn’t recall what each piece represented.

Single responsibility principle, OK, open-closed principle, sure, and then …? Maybe it’s time to revisit SOLID.

Single Responsibility Principle

Trace your existing java apps without touching a line of code

Ever since I first mucked around with Istio — a smart service mesh that runs on top of k8s — I was fascinated by its auto-injection feature. Flick the on-switch and Istio gets sprinkled across your existing deployment, giving you fantastic service-mesh powers, without modifying, repackaging or redeploying any of your existing apps in any way.

Demystifying the process a bit, Istio uses a feature of Kubernetes named “Mutating Admission Webhooks”. These are a lot simpler than they may sound. On deployment of a resource, k8s will send any active webhooks a YAML representation of the action being performed. …

Playing with Kubernetes webhooks, but need an easier way to just try things out? — ngrok to the rescue!

What’s a webhook anyway?

Or more correctly an admission webhook. It’s a HTTP callback that comes in two flavors: mutating: to dynamically change incoming deployments on the fly (think automatic Istio sidecar injection), and validating: to accept or reject those same deployments based on the rules in your callback.

For this example, I used a simple GKE (Google Kubernetes Engine) deployment.

1. Simplest webhook … ever

To start with, I just wanted to check out what exactly Kubernetes was going to send to my webhook. Let’s try out the simplest thing that we can get working — a tiny flask app:

No need to wrap this in a…

Cloud native wonders, battling tech debt, and how developers can do their bit to help with the climate crisis #jaxlondon @jaxlondon

During a week of torrential downpours, grid-locked traffic and a jam-packed tube, I spent my days absorbing new ideas at the JAX London conference in Angel Islington. Primarily a Java focused conference, its definite target is towards serious enterprise software development rather than playing with squeaky new toys — although that’s not to say there isn’t room for a few blue-sky moments.

This article is an overview of a few of my personal highlights of the conference. …

Last week I was lucky enough (aka my employer paid ;)) to attend the #OReillySACon in London. The conference was superbly arranged, and I spent two full days being immersed in some pretty interesting subjects.

To try and make some of this stuff stick I’m going to try and capture the most interesting ideas, principles and strategies that were discussed, rather than let them descend into the depths of my brain to be ignored for the rest of time. This is along the lines of the Feynman Technique or something akin to spaced repetition.

In the unlikely event that any…

As part of my #100DaysOfMLCode challenge (see here) I took, what turned out to be a fairly lengthy, break from reading to put some of the tools into practice with the Kaggle House Prices Advanced Regression challenge.

Through some ups and downs, trials and errors, I eventually progressed to a mid-table position (top 44%) which although not particularly amazing is decent enough for an initial outing. …

As I mentioned last week, I’ve set off on my journey to spend an hour a day learning about machine learning for a total of 100 days — or in real terms, because of the date I started, up to and including December 31st 2018!

Before diving into anything too complex, I decided that it was a good idea to brush up on some basic python data analysis — a topic I haven’t really touched upon for a year or more, and was never particularly proficient at in the first place, so admittedly I’m pretty rusty.

My first port of…

“Books” (CC BY 2.0) by Gael Varoquaux

It’s about that time of year again. The time to try and jump-start my machine learning career, once again.

It’s pretty clear that ML is going to become an extremely important technology in all our futures. One which will not only impact the lives of the general public, but that will also significantly affect those already shaping the tech in our world: i.e. software developers. And as one of those software developers, I think it’s important to get fairly well versed in the technology whilst it’s still relatively early on in the adoption curve.

Having said all that, this isn’t…

Two pizza teams, scrum teams, tiger teams; there are many names for these close- knit bands of high-achievers who speed past the competition to fame and fortune. And there is one factor common to any well-performing team that greatly contributes to that success - size.

Surely bigger means better? More resource means more hands to do the heavy lifting and more feet to stomp out those blazing fires. Of course, any modern worker with even a little experience understands that this is clearly not the case; but why is that?

First lets look at what principles make up a winning…

Matthew Lucas

Software developer based in the Cardiff, UK, area. Any views or opinions expressed are my own and do not reflect those of my employer past, present or future.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store