Skip to content

Instantly share code, notes, and snippets.

@perosb
Last active April 6, 2021 11:32
Show Gist options
  • Save perosb/ffa2e1b2511bdcb7529c70a7fb7c7a8a to your computer and use it in GitHub Desktop.
Save perosb/ffa2e1b2511bdcb7529c70a7fb7c7a8a to your computer and use it in GitHub Desktop.
How to create a custom solr core in Sitecore 10.1

Creating a custom core in Sitecore 10.1 using solr-init

Creating custom cores changed a bit in Sitecore 10.1 compared to 10.0 but it's still quite easy. You need to copy a "core configuration" json file in into the solr-init's \data folder. The entrypoint of solr-init will process everything here that follows the pattern:

  1. The core need to be prefixed with "sitecore_"
  2. The json file must be named cores-*.json

You need to create your own solr-init Dockerfile

# escape=`
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
COPY cores-mycore.json C:\data\cores-mycore.json
{
    "sitecore": [
        "_mycustom_index"
    ]
}

If you need to have a different naming, you need to override the entrypoint and use New-SolrCore.ps1 yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment