Trying out the new Umbraco Search

The first alpha of the new Umbraco Search was released today 🥳
This, of course, calls for a blog post. Or rather - it calls for a demo, so I have created just that.
Uh… new search?
In case you missed it, Umbraco has spent a while rethinking the built-in search offering.
An RFC was posted in the beginning of the year, which has resulted in a complete rewrite of search for Umbraco.
A few highlights of the new search include:
- Filtering and faceting by document property values.
- Support for Languages and segments.
- Support for protected documents.
- A comprehensive extension model.
- The ability to run multiple simultaneous search providers.
Umbraco Search continues to be backed by Examine as the default search provider. In my opinion there is really no other choice; Examine is the perfect match for an in-process search provider that can be shipped alongside Umbraco.
The demo site
I have created an Umbraco site to demonstrate the new search features. You’ll find it in this GitHub repo. The Umbraco database is bundled up as part of the repo, and the Umbraco admin login is:
- Username: admin@localhost
- Password: SuperSecret123
The demo site contains a bunch of “book” pages with content from The Greatest Books of All Time:
The site frontpage is search engine for these books, which is powered by an API controller. The API controller in turn is powered by the new search API.
All search result rendering performed by ~200 lines of vanilla JS.
In the following I’ll take you through the features of the demo site, and how they relate to the features of the new search.
Do keep in mind that the new search features a bunch of extension points to tailor its behavior. I have not utilized any of these in my demo site, so what’s outlined here is just the default behavior.
Full text search
Of course, the demo site sports full text search 😉
The new search can perform full text search across all fields (which is applied here) and/or within specific fields. Document names and textual properties like text fields and the rich text editor can be targeted for full text search.
Faceting
The book length and author nationality are used as exact value facets.
The publish year is used as a range facet, which groups the publish years into buckets of centuries:
The new search allows for faceting over fields that are either numerics, datetimes or keywords. Numerics and datetimes support both range and exact value faceting, while keywords only support exact value faceting.
Fixed value property editors like selectors and radio button lists yield keyword fields, as does the tags property editor.
Incidentally, the book document type in the demo site defines:
- Length as a radio button list.
- Author nationality as tags.
- Publish year as an integer.
…which enables the faceting options for these document properties.
Sorting
The found books can be sorted by relevance (score), title (document name) and publish year.
Relevance (score) is a magic field that’s generated by the search provider when calculating search results. In other words, it is not rooted in Umbraco.
Pretty much any field can be used for sorting search results. And yes, multiple sorting options can be chained - i.e. “sort by this, then by that” 👍
Alternate search providers
One of the really cool things about the new search is that it opens up for alternate search providers.
Or, to push the envelope a little; it even allows running multiple search providers simultaneously 😮
As it happens, I have published alternate search providers for Elasticsearch and Typesense on GitHub. You’ll find instructions in the repo README’s if you’re curious to try them out.
I will of course get back to all of this when I have time to write up more posts 📆
Wrapping up
The new Umbraco Search really feels like a game-changer for search in Umbraco. So many built-in goodies and extension points to tweak and tailor the search experience 🤩
This post has focused solely on the built-in features of the new search. There is so much more to cover, not least on the extensibility side of things. Rest assured I’ll be writing follow-up posts to cover more ground 🤓
Happy searching 💜