Configures Elasticsearch in Orchard Core CMS: connection setup, Docker deployment, index creation recipe steps, analyzers, queries, permissions, and migration from Lucene.
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 Elasticsearch-based search in Orchard Core.
OrchardCore.Elasticsearch to manage Elasticsearch indices.appsettings.json under the OrchardCore:Search:Elasticsearch section (Orchard Core 4.0; the former OrchardCore_Elasticsearch section is deprecated but still read). The connection can be configured globally or per tenant.CreateOrUpdateIndexProfile recipe step to create indexes (preferred over the obsolete ElasticIndexSettings step).ResetIndex recipe step to restart indexing without deleting entries (preferred over the obsolete elastic-index-reset step).RebuildIndex recipe step to delete and recreate indexes (preferred over the obsolete elastic-index-rebuild step).text and keyword types.SingleNodeConnectionPool, CloudConnectionPool, StaticConnectionPool, SniffingConnectionPool, StickyConnectionPool.Basic, ApiKey, Base64ApiKey, KeyIdAndKey.appsettings.json.OrchardCore.Search.Elasticsearch is an obsolete feature id kept for compatibility; it enables OrchardCore.Elasticsearch.OrchardCore.Elasticsearch.ElasticsearchPermissions and OrchardCore.Indexing.Core.IndexingPermissions.{ "steps": [...] }.sealed modifier.{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Search",
"OrchardCore.Elasticsearch",
"OrchardCore.Indexing"
],
"disable": []
}
]
}
Configure the connection in appsettings.json:
{
"OrchardCore": {
"Search": {
"Elasticsearch": {
"ConnectionType": "SingleNodeConnectionPool",
"Url": "http://localhost",
"Ports": [9200],
"AuthenticationType": "Basic",
"Username": "admin",
"Password": "admin",
"CertificateFingerprint": "",
"EnableDebugMode": false,
"EnableHttpCompression": true,
"IndexPrefix": "",
"Analyzers": {
"standard": {
"type": "standard"
}
}
}
}
}
}
Environment variables follow the same shape, for example OrchardCore__Search__Elasticsearch__Url.
| Property | Description |
|---|---|
ConnectionType | Connection pool type. Use CloudConnectionPool for Elastic Cloud. |
Url | Elasticsearch server URL. |
Ports | Array of ports for the Elasticsearch nodes. |
AuthenticationType | Basic, ApiKey, Base64ApiKey, or KeyIdAndKey. |
Username / Password | Required for Basic authentication. |
ApiKey | Required for ApiKey authentication. |
Base64ApiKey | Required for Base64ApiKey authentication. |
CloudId | Required for CloudConnectionPool connection type. |
KeyId / Key | Required for KeyIdAndKey authentication. |
CertificateFingerprint | TLS certificate fingerprint (not needed for CloudConnectionPool). |
EnableDebugMode | Enables debug output for troubleshooting. |
EnableHttpCompression | Enables gzip compression for requests. |
IndexPrefix | Prefix applied to all index names (useful for environment isolation). |
For local development, deploy Elasticsearch with Docker Compose.
WSL2 prerequisite — set vm.max_map_count in %userprofile%\.wslconfig:
[wsl2]
kernelCommandLine = "sysctl.vm.max_map_count=262144"
Then restart WSL: wsl --shutdown
{
"steps": [
{
"name": "CreateOrUpdateIndexProfile",
"indexes": [
{
"Name": "BlogPostsES",
"IndexName": "blogposts",
"ProviderName": "Elasticsearch",
"Type": "Content",
"Properties": {
"ContentIndexMetadata": {
"IndexLatest": false,
"IndexedContentTypes": ["BlogPost"],
"Culture": "any"
},
"ElasticsearchIndexMetadata": {
"AnalyzerName": "standard",
"StoreSourceData": true
},
"ElasticsearchDefaultQueryMetadata": {
"QueryAnalyzerName": "standard",
"SearchType": "",
"DefaultQuery": "",
"DefaultSearchFields": [
"Content.ContentItem.FullText"
]
}
}
}
]
}
]
}
| Property | Description |
|---|---|
AnalyzerName | Index-time analyzer (e.g., "standard"). |
StoreSourceData | Stores the _source data in Elasticsearch. |
QueryAnalyzerName | Analyzer used when querying this index. |
SearchType | "" (default multi-match), "query_string", or "custom". |
DefaultQuery | Custom query template when SearchType is "custom". Use {{ term }} for the search term. |
DefaultSearchFields | Array of fields to search across. |
{
"steps": [
{
"name": "ElasticIndexSettings",
"Indices": [
{
"Search": {
"AnalyzerName": "standard",
"IndexLatest": false,
"IndexedContentTypes": [
"Article",
"BlogPost"
]
}
}
]
}
]
}
{
"steps": [
{
"name": "ResetIndex",
"indexNames": [
"BlogPostsES"
]
}
]
}
{
"steps": [
{
"name": "RebuildIndex",
"indexNames": [
"BlogPostsES"
]
}
]
}
{
"steps": [
{
"name": "Queries",
"Queries": [
{
"Source": "Elasticsearch",
"Name": "RecentBlogPosts",
"Index": "BlogPostsES",
"Template": "{ \"query\": { \"match_all\": {} }, \"size\": 10 }",
"ReturnContentItems": true
}
]
}
]
}
Index is the index profile Name. Since Orchard Core 4.0, the GraphQL field of a named query requires ExecuteApi_{QueryName} (see orchardcore-content-queries).
Define built-in and custom analyzers in appsettings.json:
{
"OrchardCore": {
"Search": {
"Elasticsearch": {
"Analyzers": {
"standard": {
"type": "standard"
},
"stop": {
"type": "stop",
"stopwords": ["a", "the", "and", "or"]
},
"english_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": ["lowercase", "stop"],
"char_filter": ["html_strip"]
}
}
}
}
}
}
How the analyzer applies at index time:
text field with an analyzer in its mapping uses that analyzer first. Text fields without one, such as Content.ContentItem.FullText, use the index default.standard (AnalyzerName), it also registers that analyzer as the index's default analyzer, so text fields are analyzed with it. Rebuild existing indexes after changing the analyzer.standard or no analyzer, a matching Elasticsearch index template can still supply the default; otherwise Elasticsearch falls back to standard.QueryAnalyzerName).Define custom token filters in appsettings.json and reference them from analyzers:
{
"OrchardCore": {
"Search": {
"Elasticsearch": {
"TokenFilters": {
"english_stop": {
"type": "stop",
"stopwords": "_english_"
}
},
"Analyzers": {
"my_new_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": ["english_stop"]
}
}
}
}
}
}
When using "custom" search type, define a query with highlighting using the Liquid {{ term }} placeholder:
{
"query": {
"multi_match": {
"fields": ["Content.ContentItem.FullText"],
"query": "{{ term }}",
"fuzziness": "AUTO"
}
},
"highlight": {
"pre_tags": ["<span style='background-color: #FFF3CD;'>"],
"post_tags": ["</span>"],
"fields": {
"Content.ContentItem.FullText": {
"fragment_size": 150,
"number_of_fragments": 3
}
}
}
}
Highlight requests require StoreSourceData to be enabled on the index.
api/elasticsearch/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/elasticsearch/documents — Executes a query and returns Elasticsearch documents (stored fields only).
Same parameters as api/elasticsearch/content.
Both endpoints use the Api authentication scheme and require ElasticsearchPermissions.QueryElasticApi. Endpoint names: ApiGetElasticsearchContent, ApiPostElasticsearchContent, ApiGetElasticsearchDocuments, ApiPostElasticsearchDocuments.
| Permission | Member | Notes |
|---|---|---|
ManageElasticIndexes | OrchardCore.Elasticsearch.ElasticsearchPermissions.ManageElasticIndexes | Manage indexes, view index info, run admin queries. Implied by IndexingPermissions.ManageIndexes. |
QueryElasticsearchApi | ElasticsearchPermissions.QueryElasticApi | Call api/elasticsearch/*. Implied by ManageElasticIndexes. |
QueryIndex_{ProfileName} | IndexingPermissions.CreateDynamicPermission(indexProfile) | Query one index from the front-end search. |
In Orchard Core 4.0, the admin Index info (Elasticsearch/indexinfo/{id}) and Query (Elasticsearch/query/{indexName}) actions check ManageElasticIndexes like the other admin actions; previously they were reachable by any admin user.
Elasticsearch can return specific fields instead of full source:
{
"query": {
"match_all": {}
},
"fields": [
"ContentItemId.keyword",
"ContentItemVersionId.keyword"
],
"_source": false
}
Register a custom indexing source in Startup.cs:
using Microsoft.Extensions.Localization;
using OrchardCore.Modules;
namespace MyModule;
[Feature("MyModule.CustomElasticsearchIndex")]
public sealed class Startup : StartupBase
{
private readonly IStringLocalizer S;
public Startup(IStringLocalizer<Startup> localizer)
{
S = localizer;
}
public override void ConfigureServices(IServiceCollection services)
{
services.AddElasticsearchIndexingSource("CustomSource", o =>
{
o.DisplayName = S["Custom source"];
o.Description = S["Create an Elasticsearch index based on a custom data source."];
});
}
}
Elasticsearch automatically maps string fields to both text and keyword types. Lucene uses explicit StringField (keyword) and TextField (text) types.
| Lucene | Elasticsearch | Description | Search Query Type |
|---|---|---|---|
StringField | keyword | Indexed as a single token, not tokenized. | Term-level queries. |
TextField | text | Indexed and tokenized for full-text search. | Full-text queries. |
StoredField | _source | Original value stored, not analyzed. | Term-level queries. |
Adapt queries when switching between Lucene and Elasticsearch — field types may differ for the same field name.
OrchardCore_Elasticsearch configuration section to OrchardCore:Search:Elasticsearch (env var OrchardCore__OrchardCore_Elasticsearch__Url becomes OrchardCore__Search__Elasticsearch__Url). The old name still works; when both exist, the new one wins.OrchardCore.Elasticsearch.ElasticsearchIndexPermissionHelper.GetElasticIndexPermission(string) was removed; use OrchardCore.Indexing.Core.IndexingPermissions.CreateDynamicPermission(IndexProfile), or authorize IndexingPermissions.QuerySearchIndex against the IndexProfile resource.OrchardCore.Search.Permissions.QuerySearchIndex was removed; use IndexingPermissions.QuerySearchIndex.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-elasticsearchfrom 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./orchardcore-admin-edit-viewsSkill for writing Orchard Core admin editor views with the ocat CSS classes and cards. Covers Edit views for content parts and fields, field editor variants, part, field and site settings editors, Fields.Edit views, admin pages rendering Model.Editor built with IDisplayManager, the ocat classes and their layout rules, label associations and group captions, part and field wrapper classes, validation, hints and the Hint_Admin shape, cards declared in placement and the Card and CardContainer shapes, split editor shapes, tabs and columns, the edit page action bar, the horizontal form layout, and the UI text casing standard. Use this skill when requests mention Orchard Core admin edit views, admin forms, grouping fields in cards, Edit.cshtml, Fields.Edit.cshtml, Settings.Edit.cshtml, ocat classes, label casing, or field hints. Strong matches include ocat-wrapper, ocat-card, Hint_Admin, PlacementLocationBuilder, IDisplayManager, ContentPartDisplayDriver, SiteDisplayDriver./orchardcore-admin-listsSkill for Orchard Core 4.0 admin index views (list pages) rendered with the AdminList shape. Covers the List and Grid layouts, AdminListContext of TModel, the admin-list and admin-list-column tag helpers, column width and alignment, row display drivers placing shapes for SummaryAdmin and SummaryAdminGrid, row templates and zones, AdminListActions Buttons and Menu layouts, AdminListToolbar, AdminListSearch, the list-management script for select-all and bulk actions, IAdminListColumnsProvider, AdminListOptions, user layout selection, per-list alternates, sortable lists, and upgrading overridden list views. Use this skill when requests mention Orchard Core admin index views, an admin index page, admin lists, converting a hand-written admin listing, grid layout, list columns, row actions menu, or adding a column to the content items list. Strong matches include OrchardCore.Admin.Abstractions, AdminListContext, AdminListColumn, IAdminListColumnsProvider, AdminListOptions, AdminListLayout, ContentsAdminList./orchardcore-admin-menuSkill for creating admin menus in Orchard Core. Covers admin menu content, the link, placeholder, content types, and lists admin node types, the AdminMenu recipe and deployment step, ManageAdminMenu, ViewAdminMenuAll and per-menu ViewAdminMenu permissions from AdminMenuPermissions, custom admin nodes with AdminNode, IAdminNodeNavigationBuilder and AddAdminNode, data localization of node text, rendering in the 4.0 TheAdmin menu, and upgrading from the removed legacy admin menu layout. Use this skill when requests mention Orchard Core Admin Menu, Create and Manage Admin Menus, Admin Menu Deployment Recipe Step, Built-In Admin Node Types, Custom Admin Node Class, LegacyAdminMenuNavigation, or related implementation, setup, or troubleshooting work. Strong matches include OrchardCore.AdminMenu, OrchardCore.AdminMenu.Abstractions, AdminMenuPermissions, LinkAdminNode, PlaceholderAdminNode, OrchardCore.Lists, OrchardCore.Navigation./orchardcore-admin-schemesSkill for the Orchard Core 4.0 TheAdmin redesign and its admin schemes. Covers scheme records with their four colors, typography, density, corners, horizontal form layout and content width, Design > Themes > Schemes, the default scheme, the per-user scheme picker and its cookie, the seven built-in schemes, the AdminSchemes recipe step and Admin Schemes deployment step, the schemes.css stylesheet, the --ta-* design tokens, ta-content-fluid, dark mode utilities and nested color modes, TheOldAdmin and how to switch to it, and the breaking changes for custom admin themes and Layout overrides. Use this skill when requests mention admin schemes, admin colors, rebranding TheAdmin, dark mode of the admin, the admin content width, the horizontal form layout, TheOldAdmin, or upgrading a custom admin theme to the new TheAdmin. Strong matches include AdminScheme, AdminSchemes, DefaultSchemeId, HorizontalFormLayout, ContentWidth, data-ta-scheme, --ta-primary, ta-content-fluid, TheOldAdmin, and OrchardCore.Themes.TheAdmin.Other plugins' skills for the same job