Lucene index rebuild and reset steps, Lombiq GitHub Actions - This week in Orchard (21/10/2022)

Gábor Domonkos's avatar
Admin UI, Query, Documentation, This week in Orchard, Recipes

Lucene index rebuild and reset steps, update all action bars, utilize ContentTypeExtensions, and a demo about the Lombiq GitHub Actions project! Do we need to tell more about the content of our current post? Let's jump into the recent news of Orchard Core!

Orchard Core updates

Lucene index rebuild and reset steps

Currently, when we are creating a search index from a recipe it doesn't build the index. This causes issues with Lucene and Elasticsearch where the Queries won't return any results, and also Elasticsearch will log an issue about "all shards failed" if nothing has been indexed yet in its indexes. It would be nice to be able to trigger an index to be rebuilt or reset from a scheduled background task as a one-time-only task. And from now on, you will find two new recipe steps that will help you with that:

  • The Reset Lucene Search Index Step resets a Lucene index.
  • The Rebuild Lucene Search Index Step rebuilds a Lucene index.

You can find more information about how you can use these new recipe steps in the Orchard Core documentation.

New Lucene recipe steps

Update all action bars

We have some improvements regarding the action bars on the admin UI of Orchard Core. As you can see on the screen below, there was a lot of wasted space between the search box and the New button. There was an extra round space between the filter icon and the search box and we also had uneven spaces, as you can see. The other thing is when using a mobile phone to manage contents (or any view with an action bar), the search input on the top shows up very small because of the wasted space between the search box and the New button.

The action bar before the changes

And here you can see the updated action bar. You can see that all of the mentioned issues are resolved like the search box is now longer, and we have equal spaces.

The action bar after the changes

Utilize ContentTypeExtensions

We have had a static class called ContentTypeExtensions for a while now in the source, which contains several useful extensions. Like shortcuts to tell that the given content type is creatable, versionable, has stereotypes, and so on.

The ContentTypeExtensions class

Here the goal was to use the newly added extensions ContentTypeExtensions across the solution.

Utilizing the ContentTypeExtensions


Lombiq GitHub Actions

The Lombiq GitHub Actions project contains extensions that make a lot of things very easy in an Orchard Core or an Orchard Core-based project. If you don't know GitHub Actions or aren't entirely clear with the terminology, GitHub actions are GitHub's automation platform or CI/CD platform. Orchard Core of course also uses it to run various builds. And how you define a pipeline there is by creating workflows and/or composite actions. Workflows are what actually run, and actions are something that you can add on your own as well, these are things that workflows can call. Workflow is kind of like a program, and action is like a library that your program calls into. And of course, actions can be third-party as well. The point here is that you can use GitHub actions to automate a lot of things, like .NET builds, running tests, and doing various verifications on a pull request, and you can also do all kinds of modularization between these builds.

The Lombiq GitHub Actions project

And what we have under this project are workflows and actions. Workflows that you can call from your own workflows. Pretty much like one-liners, for example, to run the .NET build and execute a test. Actions are the building blocks that you can also use if you just want to have something specific. And we have quite a lot of actions and workflows here.

The Build and Test Orchard Core solution workflow

Let's check out the workflow called Build and Test Orchard Core solution workflow! Here you can see how you use it. The example above is not even a minimal usage actually, it can be even shorter. This can be your GitHub Actions workflow in your own repository with an Orchard Core application, where you execute the workflow that we provide here. This is actually used in Orchard Core Commerce as well. If you check out the build-and-test.yml file inside the repository, you will find all the code that is necessary to run such builds.

The Build and Test Orchard Core solution workflow in the Commerce module

If you check out the details of a pull request inside the Commerce repository, you will see there are builds for Ubuntu and Windows as well. These are all the automated checks that we run. This is quite a long build because it's not just a .NET build, it also runs all kinds of static code analysis. It verifies that .NET packages are consolidated, and it also runs unit and UI tests with SQL Server and Azure Storage actually.

A GitHub action in the Orchard Core Commerce module

And the Lombiq GitHub Actions projects contain a lot more than that! Are you interested in the details of what you can achieve if you use this project in yours too? If your answer is yes, or you want to know more about this automation platform check out this recording on YouTube for more!

News from the community

Orchard Dojo Newsletter

Lombiq's Orchard Dojo Newsletter has 365 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course.

Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here!

If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

No Comments

Add a Comment