Beckshome.com: Thomas Beck's Blog

Musings about technology and things tangentially related

Lucene + Blazor, Part 5: Highlighting

In this final installment of my Blazor + Lucene.Net series, we’ll be adding highlights for the search terms found in the header and body text of each of our results. The implementation of highlighting makes use of the Lucene.Net.Highlighter library, plugging this library into a simple method that can be used as a filter for search results to highlight key terms.

The code and code narrative below reflects the changes that have been made on top of the first 4 posts. All source code is available online for this highlighting post.


Lucene + Blazor, Part 4: Faceting

In this fourth installment of my Blazor + Lucene.Net series, we’ll make the most significant updates to the classes, search function and UI to date. Facets enrich the query responses, enabling users to further tune the search results along specific, pre-defined vectors. The implementation of facets uses the Lucene.Net.Facet library to implement an additional faceted index over two attributes – Scholars and Universities – which are applied on top of the WaffleText class and data.


Lucene + Blazor, Part 3: Auto Complete

In this third installment of my Blazor + Lucene.Net series, I’ll start tackling some advanced Lucene functionality, namely auto-complete. For advanced Lucene work, the most important lessons is don’t roll your own functionality. If you go to the docs for the Lucene.Net API, you’ll see that a ton of additional functionality is built into Lucene via modules. Modules exist for faceting, highlighting, spatial search and autosuggest, amongst others. Lots of the examples and StackOverflow answers are roll-your-own solutions – don’t do it!!


Lucene + Blazor, Part 2: Results Paging

In the first installment of this series, we looked at returning results from a limited pool of items in a Lucene full text index. In this second installment, we significantly increase the number of generated items (3,000, by default) and add a numbered paging system, as used by the main commercial search engines and search sites.

The code and code narrative below reflects the changes that have been made since the first post. All source code is available online for this results paging post.


Lucene + Blazor, Part 1: Basic Search

Lucene.NET is a C# port of the Java Lucene search engine library. Lucene.NET provides robust search and index capabilities enhanced by a wide array of support packages (e.g. auto-suggest, faceting) that enable the creation of robust search facilities within .NET applications.

While useful and recent tutorials exist on using Lucene.NET in a command line context, there is a dearth of tutorials on using Lucene.NET in a web context, especially with the current Blazor framework. This tutorial fills that gap, with this existing article being the first in a series that will illustrate the buildout of a Blazor-based search site.


Dotnet Lightweight Databases

My popular dotnet-blazor-crud project has long used the EF Core InMemory database provider for data persistence. While this hasn’t caused me any issues – ever, I’ve been aspiring to move to a relational database versus an in-memory provider. SQLite is the obvious contender here, without going to a full out-of-process database. Getting started with SQLite and EF Core is pretty easy. The real question for me was how much work it would take to swap out the in memory provider for SQLite.


Mermaid Diagrams in Statiq

According to the definition on the Mermaid site, Mermaid is a JavaScript based diagramming and charting tool that renders Markdown-inspired text definitions to create and modify diagrams dynamically. In short, when creating online Markdown-based documentation or publications, like with GitHub or with static site generators that use Markdown to generate content, you can move from static images to dynamically generated diagrams. Mermaid currently supports diagrams such as flowcharts, sequence diagrams, class diagrams, ER diagrams and Gantt charts with more diagrams being added.


Early Tech Publications

In porting my blog to Statiq, I was forced to revisit a whole lot of content, most of which is more than a decade old. As part of this review, I cleaned up old broken links, of which there were many. I would estimate that 60% of the web links I had from my original blog pages were to sites or content that no longer existed. This says a lot about how the web has evolved and how much content turns over as time progresses.


Beckshome on Statiq

After 7 years of being dormant, the beckshome.com blog hummed back to life over the past month. It started with a full .NET hosted blog, moved to Wordpress and then was exported from Wordpress to create static content in 2015, which is where things stood for the past 7 years. I decided to go with a static site generator to modernize the site, specifically with Statiq, which is a .NET-based static site generator.


Technology Links - January 11, 2015

Couple of exciting things to link to from last week: