Elasticsearch allows indexing multiple values into a field, and to query on that field to find documents with matching values. This post explores some different ways of querying values, including approaches for matching values in the last position.
Blog
-
-
A short journey into fixing a build bug involving strongly named dynamic assemblies,
InternalsVisibleTo
, and building from the command line with dotnet CLI -
I do a fair bit of work with VMs somedays, using them for a variety of purposes, including integration tests for Windows installers and building components for different platforms. Much of this work runs headless without a GUI and without manual intervention.
Sometimes things can go awry with a process, such as not shutting down as expected and keeping a handle open to a file that should be deleted, or spawning other processes and threads unexpectedly. When this happens on a Windows VM, it's useful to run Process Monitor a.k.a. Procmon on the remote VM to capture process activity for further investigation. This is the topic of today's post.
I've put together a small PowerShell script module to make the process of running Procmon on a remote Windows VM easier, and will walkthrough how to use it.
-
I recently came across a question on Stack Overflow asking about Boosting elasticsearch results with NEST when a secondary field is a specific value. I thought the question was interesting enough to warrant a blog post, the first I've written in a while!
-
I recently came across an issue within a pipeline of asynchronous method calls where an attempt to deserialize a response from json to a known type may throw an exception, usually when the response is not json. For example, this may be the case when using something like nginx as a proxy for authentication purposes and failed authentication returns a HTML page. A simple reproducible example would be
void Main() { MainAsync().Wait(); } async Task MainAsync() { var result = await TryDeserializeAsync().ConfigureAwait(false); Console.WriteLine(result); } Task<double?> TryDeserializeAsync() { try { return DeserializeAsync(); } catch { // swallow any exceptions thrown. } return null; } async Task<double?> DeserializeAsync() { await Task.Delay(100); throw new Exception("Serialization error"); }
Here we await
TryDeserializeAsync()
which in turn calls the actualDeserializeAsync()
implementation, swallowing any exception that may occur in deserialization and simple returningnull
. That's the plan anyway. -
A few weeks ago, the Geocoded National Address File (a.k.a. G-NAF) was made openly available by PSMA, an unlisted public company formed by the nine governments of Australia to collate and standardise, format and aggregate location data from each of the jurisdictions into authoritative location based national datasets. The reason this is such great news is nicely summarised on data.gov.au
-
Early last month I had the pleasure of presenting on Akka.NET to the F# Sydney meetup user group. The presentation is largely an introduction to agent-based programming and the Actor model of computation with Akka.NET from a functional programming perspective, using the Akka.NET F# API.
The slides and code can be found up on Github
-
In my last post I gave an example of how to use the bulk api to index many documents at a time into Elasticsearch. Once all of the documents have been indexed, it is very likely that we'll want to update individual documents within the index; In this post, we'll look at how to do this and some of the features available to manage multiple concurrent update requests to a given document.
-
In this blog post I’m going to show you how to get started with geospatial search with Elasticsearch, using the official and fantastic .NET client for Elasticsearch, NEST. An example like this is best served with real data, so given this post was written from Australia, we’ll use the State Suburbs (SSC) from 2006 provided by the Australian Bureau of Statistics as the data of interest; it's provided in ESRI Shapefile format and contains a collection of all the Australian Suburbs, each with a name, code and geometry; We’ll need to extract each suburb from the Shapefile and serialize them to a format that can be persisted to Elasticsearch and so that we can query them.
TL;DR
I’ve put together a demo application to illustrate geospatial search using Elasticsearch and NEST..
-
I wanted to share a setup that has been working well for me for some time in keeping the layout of C# code consistent, easier to maintain and smoother when it comes to merging changes into git. It leverages ReSharper and SemanticMerge, two really awesome tools that allow you to remain focused on delivering features with minimum fuss.
With this setup, a simple keyboard shortcut restructures a C# code file according to defined settings, performing such actions as reordering members according to type, accessibility and name, removing regions, sorting Using directives and updating file headers. When it comes to merging these changes into source control, we can merge with confidence as SemanticMerge parses the C# file to determine changes at the class structural level, meaning we can happily reorder members ‘til our hearts content and let SemanticMerge deal with the fallout of determining the real changes. Enough of the hyperbole, let’s get set up!