ElasticSearch - nested mappings and filters
There's one situation where we need to help ElasticSearch to understand the structure of our data in order to be able to query it fully - when dealing with arrays of complex objects.Arguably one of the...
View ArticleDynamic mappings and dates in ElasticSearch
JSON doesn't have a date type. Yet ElasticSearch can automatically map date fields for us. While this "just works" most of the time, it can be a good idea to help ElasticSearch help us by instead using...
View ArticleNotes from learning Go - the basics
I recently decided to learn Go. As in Go the programming language, also known as golang. These are my notes from doing so. In the form of code.Hello Worldpackage main//Here's a commentimport "fmt"func...
View ArticleBook announcement: ElasticSearch Quick Start
I'm happy to announce a book that I've been meaning to write for quite some time - An introduction to ElasticSearch for developers in tutorial form.About 18 months ago I was working on a customer...
View ArticleResponsibly Responsive Web Design at Expressen
When building a new version of the news site Expressen.se the team hesitated to use responsive web design. Here's why and what we ended up doing.Expressen.se is the second largest news site in the...
View ArticleQuickly creating and mapping an array in JavaScript
When, for instance, creating test data one might do something like this:const data = [];for(let i = 0; i < 100; i++) { data.push({ num: i }); }This may be written slightly shorter and more wrist...
View ArticleQuickly mapping an array of URLs to responses with JavaScript async/await and...
While perhaps not the most readable, a compact version (using window.fetch) can look like this:const urls = [ "https://jsonplaceholder.typicode.com/comments/1",...
View ArticleFlatten array of arrays with JavaScript
const arrays = [[1], ["2"], [3]];const merged = [].concat(...arrays);console.log(merged); // [ 1, '2', 3 ]Pre ES6:var merged =[].concat.apply([], arrays);
View ArticleException order when awaiting multiple async tasks in C#
A C# has-been returns to C# and experiments with this new hip thing called async/await and how that relates to execution order and exceptions.I recently returned to .NET and C# development after a six...
View ArticleWhy is the async keyword needed in JavaScript?
Last week a colleague asked me what the purpose of the async keyword was in JavaScript. Not because he didn't know how to use async/await. He was wondering why the async keyword was needed to use...
View Article