Install/OnPrem/Solr/custom-solr.json
{
"Parameters": { "SolrUrl": { "Type": "string", "DefaultValue": "https://localhost:8983/solr", "Description": "The Solr instance url." }, "SolrRoot": { "Type": "string", "DefaultValue": "c:\\solr-6.6.2", "Description": "The file path to the Solr instance." }, "SolrService": { "Type": "string", "DefaultValue": "Solr-6.6.2", "Description": "The name of the Solr service." }, "BaseConfig": { "Type": "string", "DefaultValue": "basic_configs", "Description": "The configset to copy as a base for each core." }, "CorePrefix": { "Type": "string", "DefaultValue": "sitecore", "Description": "The prefix for each of the created indexes." }, "CoreName": { "Type": "string", "Description": "Name of custom core." } }, "Variables": { "Solr.FullRoot": "[resolvepath(parameter('SolrRoot'))]", "Solr.Server": "[joinpath(variable('Solr.FullRoot'), 'server', 'solr')]", "Solr.BaseConfigs": "[joinpath(variable('Solr.Server'), 'configsets', parameter('BaseConfig'))]", "Solr.SchemaFileName": "managed-schema", "Solr.Xpath.SchemaRoot": "//schema", "Solr.Xpath.UniqueKey": "[concat(variable('Solr.Xpath.SchemaRoot'), '/uniqueKey')]", "Solr.UniqueField": "_uniqueid", "Solr.UniqueField.Attributes": { "name": "[variable('Solr.UniqueField')]", "type": "string", "indexed": "true", "required": "true", "stored": "true" }, "Custom.Name": "[concat(parameter('CorePrefix'), '_', parameter('CoreName'))]", "Custom.Root": "[joinpath(variable('Solr.Server'), variable('Custom.Name'))]", "Custom.Conf": "[joinpath(variable('Custom.Root'), 'conf')]" }, "Tasks": { "StopSolr": { "Type": "ManageService", "Params": { "Name": "[parameter('SolrService')]", "Status": "Stopped", "PostDelay": 1000 } }, "CleanCores": { "Type": "EnsurePath", "Params": { "Clean": [ "[variable('Custom.Root')]" ] } }, "PrepareCores": { "Type": "Copy", "Params": [ { "Source": "[joinpath(variable('Solr.BaseConfigs'), '*')]", "Destination": "[variable('Custom.Root')]" } ] }, "AddSchemaUniqueKeyField": { "Type": "SetXml", "Params": [ { "FilePath": "[joinpath(variable('Custom.Conf'), variable('Solr.SchemaFileName'))]", "Xpath": "[variable('Solr.Xpath.SchemaRoot')]", "Element": "field", "Attributes": "[variable('Solr.UniqueField.Attributes')]" } ] }, "UpdateSchemaUniqueKey": { "Type": "SetXml", "Params": [ { "FilePath": "[joinpath(variable('Custom.Conf'), 'managed-schema')]", "Xpath": "[variable('Solr.Xpath.UniqueKey')]", "Value": "[variable('Solr.UniqueField')]" } ] }, "StartSolr": { "Type": "ManageService", "Params": { "Name": "[parameter('SolrService')]", "Status": "Running", "PostDelay": 8000 } }, "CreateCores": { "Type": "ManageSolrCore", "Params": [ { "Action": "Create", "Address": "[parameter('SolrUrl')]", "Arguments": { "Name": "[variable('Custom.Name')]" } } ] } } } |