Configures Lucene search in Orchard Core CMS: index creation, recipe steps, Lucene Query API with Elasticsearch DSL, permissions, and the Lucene Worker background task.
Ships in orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an Orchard Core expert. Generate code and configuration for Lucene-based full-text search in Orchard Core.
OrchardCore.Lucene to manage Lucene indexes./App_Data/Sites/{TenantName}/Lucene/{IndexName}.CreateOrUpdateIndexProfile recipe step to create indexes (preferred over the obsolete lucene-index and LuceneIndexSettings steps).ResetIndex recipe step to restart indexing from the beginning without deleting existing entries (preferred over the obsolete lucene-index-reset step).RebuildIndex recipe step to delete and recreate the full index (preferred over the obsolete lucene-index-rebuild step).bool, match, match_all, match_phrase, term, terms, wildcard, prefix, fuzzy, range, regexp, query_string, simple_query_string, geo_distance, geo_bounding_box..keyword suffix are automatically stored in the index (max 256 chars) for term-level queries.OrchardCore.Search.Lucene.Worker only when running the same tenant on multiple instances (farm) with a file system index.OrchardCore.Search.Lucene is an obsolete feature id kept for compatibility; it enables OrchardCore.Lucene. Use OrchardCore.Lucene in new recipes.OrchardCore.Lucene.LuceneSearchPermissions and OrchardCore.Indexing.Core.IndexingPermissions; the old OrchardCore.Lucene.Permissions.* and LuceneIndexPermissionHelper.ManageLuceneIndexes members were removed in Orchard Core 4.0.{ "steps": [...] }.sealed modifier.{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Search",
"OrchardCore.Lucene",
"OrchardCore.Indexing"
],
"disable": []
}
]
}
Use CreateOrUpdateIndexProfile to create a Lucene index for content items:
{
"steps": [
{
"name": "CreateOrUpdateIndexProfile",
"indexes": [
{
"Name": "BlogPostsLucene",
"IndexName": "blogposts",
"ProviderName": "Lucene",
"Type": "Content",
"Properties": {
"ContentIndexMetadata": {
"IndexLatest": false,
"IndexedContentTypes": ["BlogPost"],
"Culture": "any"
},
"LuceneIndexMetadata": {
"AnalyzerName": "standard",
"StoreSourceData": true
}
}
}
]
}
]
}
| Property | Description |
|---|---|
Name | Unique display name for the index profile. |
IndexName | Physical index name on disk. |
ProviderName | Must be "Lucene". |
Type | Source category, typically "Content" for content items. |
IndexLatest | When true, indexes both published and draft items. Default false indexes published only. |
IndexedContentTypes | Array of content type names to include. |
Culture | "any" for all cultures or a specific culture code. |
AnalyzerName | Lucene analyzer name (e.g., "standard"). |
StoreSourceData | When true, stores source data for retrieval. |
The lucene-index step is obsolete but still supported:
{
"steps": [
{
"name": "lucene-index",
"Indices": [
{
"Search": {
"AnalyzerName": "standard",
"IndexLatest": false,
"IndexedContentTypes": [
"Article",
"BlogPost"
]
}
}
]
}
]
}
Restarts indexing from the beginning without deleting existing entries:
{
"steps": [
{
"name": "ResetIndex",
"indexNames": [
"BlogPostsLucene"
]
}
]
}
To reset all indices:
{
"steps": [
{
"name": "ResetIndex",
"IncludeAll": true
}
]
}
Deletes and recreates the full index content:
{
"steps": [
{
"name": "RebuildIndex",
"indexNames": [
"BlogPostsLucene"
]
}
]
}
To rebuild all indices:
{
"steps": [
{
"name": "RebuildIndex",
"IncludeAll": true
}
]
}
{
"steps": [
{
"name": "Queries",
"Queries": [
{
"Source": "Lucene",
"Name": "RecentBlogPosts",
"Index": "BlogPostsLucene",
"Template": "{ \"query\": { \"match_all\": {} }, \"size\": 10 }",
"ReturnContentItems": true
}
]
}
]
}
Index is the index profile Name (not the physical IndexName). Saved Lucene queries are executed through api/queries/{name}, Liquid (Queries.RecentBlogPosts | query), GraphQL and the Queries data source (see orchardcore-content-queries and orchardcore-data-sources). Since Orchard Core 4.0, the GraphQL field of a named query requires the ExecuteApi_{QueryName} permission (implied by ExecuteApiAll and ManageQueries).
Query filters retrieve records without considering boost values, similar to SQL filtering.
Bool filter with term and wildcard:
{
"query": {
"bool": {
"filter": [
{
"term": {
"Content.ContentItem.Published": "true"
}
},
{
"wildcard": {
"Content.ContentItem.DisplayText": "Main*"
}
}
]
}
}
}
Bool with must and filter (filtering by content type):
{
"query": {
"bool": {
"must": {
"term": {
"Content.ContentItem.ContentType.keyword": "Menu"
}
},
"filter": [
{
"term": {
"Content.ContentItem.Published": "true"
}
},
{
"wildcard": {
"Content.ContentItem.DisplayText": "Main*"
}
}
]
}
}
}
Full-text search with query_string:
{
"query": {
"query_string": {
"query": "Content.ContentItem.FullText:\"exploration\""
}
}
}
Full-text search with simple_query_string and default field:
{
"query": {
"simple_query_string": {
"query": "\"exploration\"",
"fields": [
"Content.ContentItem.FullText"
]
}
}
}
api/lucene/content — Executes a query and returns content items.
Verbs: POST and GET
| Parameter | Example | Description |
|---|---|---|
indexName | "search" | The name of the index to query. |
query | { "query": { "match_all": {} }, "size": 10 } | JSON query object. |
parameters | { "size": 3 } | JSON parameters object. |
api/lucene/documents — Executes a query and returns Lucene documents (stored fields only).
Same parameters as api/lucene/content.
Both endpoints use the Api authentication scheme and require LuceneSearchPermissions.QueryLuceneApi. Their endpoint names are ApiGetLuceneContent, ApiPostLuceneContent, ApiGetLuceneDocuments and ApiPostLuceneDocuments (used by OpenAPI, see orchardcore-openapi).
| Permission | Member | Notes |
|---|---|---|
ManageLuceneIndexes | OrchardCore.Lucene.LuceneSearchPermissions.ManageLuceneIndexes | Manage Lucene indexes and run admin queries. |
QueryLuceneApi | OrchardCore.Lucene.LuceneSearchPermissions.QueryLuceneApi | Call api/lucene/*. Implied by ManageLuceneIndexes. |
QueryIndex_{IndexName} | IndexingPermissions.CreateDynamicPermission(indexProfile) | Query one index from the front-end search. Implied by ManageIndexes and QuerySearchIndex. |
QuerySearchIndex | OrchardCore.Indexing.Core.IndexingPermissions.QuerySearchIndex | Query any index. |
A PermissionMigrations deferred task rewrites the legacy per-index role claims (QueryLucene{IndexName}Index) to the dynamic QueryIndex_{ProfileName} permissions once the index profiles exist.
OrchardCore.Lucene.Permissions.ManageLuceneIndexes and OrchardCore.Lucene.LuceneIndexPermissionHelper.ManageLuceneIndexes were removed; use OrchardCore.Lucene.LuceneSearchPermissions.ManageLuceneIndexes.OrchardCore.Lucene.Permissions.QueryLuceneApi was removed; use OrchardCore.Lucene.LuceneSearchPermissions.QueryLuceneApi.OrchardCore.Search.Permissions.QuerySearchIndex was removed; use OrchardCore.Indexing.Core.IndexingPermissions.QuerySearchIndex./ becomes _47) to prevent path traversal. An index whose full name contains such characters resolves to a new, empty directory after the upgrade; rebuild it.type of a Lucene query sort is now parsed with culture-invariant casing, so a lowercase type no longer fails on servers running a culture such as Turkish.Enable OrchardCore.Search.Lucene.Worker to synchronize the local file system index across multiple instances. This creates a background task that keeps indexes in sync in a farm scenario.
Do not enable the Worker if:
Register a custom indexing source in Startup.cs:
using Microsoft.Extensions.Localization;
using OrchardCore.Modules;
namespace MyModule;
[Feature("MyModule.CustomLuceneIndex")]
public sealed class Startup : StartupBase
{
private readonly IStringLocalizer<Startup> _localizer;
public Startup(IStringLocalizer<Startup> localizer)
{
_localizer = localizer;
}
public override void ConfigureServices(IServiceCollection services)
{
services.AddLuceneIndexingSource("CustomSource", o =>
{
o.DisplayName = _localizer["Custom Source"];
o.Description = _localizer["Create a Lucene index based on a custom data source."];
});
}
}
Lucene automatically maps text fields with a .keyword suffix as stored values in the index, unless the document is already explicitly stored. Values longer than 256 characters are ignored. This enables any TextField to be searched using term queries by appending .keyword to the field name.
For example, to query by the exact DisplayText value, use Content.ContentItem.DisplayText.keyword in a term query.
Official Orchard Core videos shown on the documentation page:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/orchardcore:orchardcore-lucenefrom orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin orchardcore140 skills in this plugin
/orchardcore-adminGuidance for the Orchard Core admin panel, including admin controllers and routes, admin menu registration with AdminNavigationProvider, ocat editor forms grouped in cards, admin pages rendering Model.Editor, the UI text casing standard, TheAdmin layout and menu colors, admin branding, the Navbar shape, the Ctrl+K quick navigation palette and QuickNavigationSource, AdminSettings such as MenuBehavior, ShowBreadcrumb, DisplayQuickNavigation, DisplayTitlesInTopbar and ActionsLayout, the AdminDashboard shape, settings pages, and admin filters and zones. Use this skill when requests mention the Orchard Core admin panel, TheAdmin, admin controllers, admin menu registration, an icon on an admin menu item, the AdminSettings recipe step, quick navigation, navigation menu behavior, the admin URL prefix, UI text casing. Strong matches include OrchardCore.Admin, AdminSettings, AdminPermissions, AdminOptions, AdminAttribute, SiteDisplayDriver, IDisplayManager./orchardcore-admin-dashboardSkill for creating admin dashboard widgets in Orchard Core. Covers the DashboardWidget stereotype, DashboardPart position and sizing, the built-in HtmlDashboardWidget, ContentsMetadata and ContentsTags widget types, custom widget content types via recipe or migration, arranging widgets in Manage Dashboard mode, widget template customization, provisioning widgets with recipes, dashboard permissions, the DashboardBreadcrumbProvider Dashboard ancestor, and the AdminDashboardContent shape used when the feature is disabled. Use this skill when requests mention Orchard Core Admin Dashboard, Create and Configure Dashboard Widgets, Enabling Admin Dashboard, Widget Configuration Properties, dashboard widget recipes, Dashboard breadcrumb, or related implementation, setup, or troubleshooting work. Strong matches include OrchardCore.AdminDashboard, DashboardPart, DashboardBreadcrumbProvider, AccessAdminDashboard, ManageAdminDashboard.Other plugins' skills for the same job