Orchard Core 1.8, add a way to provide a custom Elasticsearch query - This week in Orchard (12/01/2024)

Gábor Domonkos's avatar
Announcement, Query, This week in Orchard, Content part

We are thrilled to announce that Orchard Core 1.8 is now available! Check out this post to know everything about the latest release of Orchard Core. In the upcoming weeks, we will check out the newest features and additions of Orchard Core 1.8. Let's get started!

Orchard Core updates

Fix an exception when creating content type without any content part

Let's assume the scenario where you create a new content type with a name but you are not adding any content parts to it. If you hit Save without any added content parts, you will get a NullReferenceException. The fix here is to check if the partNames array is null. The same check applies to the fieldNames array as well.

Fix an exception when creating content type without any content part

Add a way to provide a custom Elasticsearch query

In the search module, the only available option to conduct a search is using query-string or multi-match query by providing a list of default fields to search. What if we want to customize the query, for example, by using fuzziness or other options? Currently, there is no simple way to configure the default search to use advanced search options.

This is a new feature such that you can define what is sent to Elasticsearch when you type some terms in the search box. As you can see in the following screencast; you can define the following custom query to perform advanced operations like fuzziness.

{
"query": {
"match": {
"Content.ContentItem.FullText": {
"query": "{{ term }}",
"fuzziness": "AUTO",
"analyzer": "whitespace"
}
}
}
}

The documentation page of the Elasticsearch module has also been updated, and the example for setting the default search settings accepts a SearchType option where you can use 'custom' for a custom query in DefaultQuery and 'query_string' for a Query String Query search. Leave it blank for the default, which is a Multi-Match Query search.

Add a way to provide a custom Elasticsearch query

News from the community

Orchard Core 1.8 and Orchard Core 1.8.1

The community recently released the latest 1.8 version of Orchard Core with several new features and additions! In this update, we've introduced several significant changes that may require your attention before upgrading. Additionally, performance-related enhancements have been implemented to optimize your app's scalability, especially when dealing with a large number of tenants.

The Admin Theme was upgraded to Bootstrap 5, and from now on, the theme mode is set to auto, which allows us to use the default device color preference, which could be dark or light. A new option for restarting a specific Workflow instance has been incorporated, involving adjustments to both the IActivity and IWorkflowManager interfaces, and the HTTP error views are now in the form of shapes. The upper navigation bar has been transformed into a customizable shape (Navbar shape), allowing for easy integration of items. As an enhancement for the Elasticssearch feature, we introduced a new option that permits the definition of a custom query for the default search. And we have a lot more to cover! Here are all the details of the release.

Note that this release removes support for net6.0 and net7.0. Only net8.0 is supported.

Orchard Core 1.8.1 was released a few days after the 1.8 one to address some issues of the 1.8 release. If you open up nuget.org and search for the OrchardCore.Application.Cms.Targets package, you will find the newest released version of Orchard Core! Upgrade your solution to 1.8.1 now! Feel free to drop on the dedicated Gitter chat or use the Discussions on GitHub and ask questions!

Orchard Core 1.8 release details

As we mentioned, Orchard Core is available as a NuGet package which you can easily add to your ASP.NET Core solution. Here's how you can get started with Orchard Core.

Orchard Dojo Newsletter

Lombiq's Orchard Dojo Newsletter has 480 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 would like to read our weekly articles? Tell them to subscribe here!

If you are interested in more news about 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