Last active
February 26, 2019 14:30
-
-
Save kamsar/ef8811bd458603f1e808 to your computer and use it in GitHub Desktop.
Sitecore Solr Cannon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script will set up (and install if needed) Apache Solr for a Sitecore instance. | |
# This does NOT configure Sitecore to use Solr, | |
# just the Solr server and cores for Sitecore to connect to once it is set up to use Solr. | |
# So, what does it do? | |
# | |
# * Installs SOLR, if needed, from the Bitnami SOLR stack: https://bitnami.com/stack/solr/installer | |
# * Creates a SOLR config set for the cores to share (shared schema) | |
# * Creates SOLR cores for all Sitecore indexes, including secondary cores to support online reindexing (Switch on Rebuild) | |
# * Generates a Sitecore config patch file to point Sitecore at the created cores, and this SOLR server | |
# | |
# PREREQUISITES | |
# * If you need to install SOLR, download the Bitnami stack (tested with SOLR 5.5.0-1) and set the $SolrInstallerPath below | |
# * If you wish to use a custom JVM (e.g. x64 server JVM) configure a path to its JAVA_HOME below. | |
# * Review the other settings below to make sure they are what you want | |
# | |
# Need to regenerate the included schema.xml file (generated against SC8.1U1)? See https://kb.sitecore.net/articles/227897 | |
# | |
# Useful resources: | |
# Sitecore Community Docs on Solr https://sitecore-community.github.io/docs/search/solr/Configuring-Solr-for-use-with-Sitecore-8/ | |
# Optimizing Bitnami for production (important) http://www.sitecorecoding.com/2015/08/solr-with-sitecore-checklist.html | |
# NOTE: you can find JVM startup settings in $(bitnami)\apache-solr\bin\solr.in.cmd, service reinstall not required | |
# General directions for setting up the Sitecore Solr provider http://sitecoreblog.patrickperrone.com/2015/02/sitecore-8-solr-part33-configur-ageddon.html | |
# Swapping search providers script http://sitecoreblog.patrickperrone.com/2015/03/a-script-to-swap-search-in-sitecore.html | |
# Essential! No-Container Solr IoC: https://github.com/stephenpope/sitecore-solr-powerpack/tree/master/src/Sitecore.ContentSearch.SolrProvider.NoContainer | |
$ErrorActionPreference = 'Stop' | |
# VARIABLES (review me) | |
$ProjectName = "mysite" # used as a prefix to SOLR core names, so more than one project can fit | |
$SolrPath = "$($env:SystemDrive)\Solr" # Path to SOLR (either to install or to update if existing) | |
$SolrInstallerPath = "$PSScriptRoot\bitnami-solr-5.5.0-1-windows-installer.exe" | |
$SolrPort = 8981 # note: this port and the next three above it will be used. This is the primary port. | |
$SitecoreIndexNames = @('sitecore_core_index', 'sitecore_master_index', 'sitecore_web_index', 'sitecore_analytics_index', 'sitecore_marketing_asset_index_master', 'sitecore_marketing_asset_index_web', 'sitecore_marketingdefinitions_master', 'sitecore_marketingdefinitions_web', 'sitecore_testing_index', 'sitecore_suggested_test_index', 'sitecore_fxm_master_index', 'sitecore_fxm_web_index', 'sitecore_list_index', 'social_messages_master', 'social_messages_web') | |
$SitecoreSingleIndexNames = @('sitecore_analytics_index') # These indexes will not be set to switch on rebuild | |
$MaxWarmingSearchers = 8 # see http://www.sitecorecoding.com/2015/08/solr-with-sitecore-checklist.html | |
# Solr Java Settings | |
# (only applied if you install Solr with this script, not for adding cores to existing) | |
$JavaHome = '' # Optionally hook Solr to an alternate JRE than the default that Bitnami ships (e.g. an x64 one for production > 4GB ram) | |
# Grab a server JRE quick like with Chocolatey: choco install server-jre8 -y | |
$JvmHeapArgs = '-Xms512m -Xmx1024m' # pass a min and max heap size to Solr's java. 512m is the default, you probably want more for production. | |
# Derived settings | |
$SolrHome = "$SolrPath\apache-solr\solr" | |
$SolrBaseUrl = "http://$($env:ComputerName):$SolrPort/solr" | |
$SolrConfigSetName = "$($ProjectName)_configs" | |
function Install-Solr($installerPath, $rootPath, $port) { | |
& $installerPath --unattendedmodeui minimalWithDialogs --mode unattended --prefix $rootPath --apache_server_port $($port+2) --apache_server_ssl_port $($port+3) --apache_solr_port $port --apache_solr_stop_port $($port+1) --launchbch 0 --base_user "fake" --base_password "fake" | out-null | |
$configPath = "$rootPath\apache-solr\bin\solr.in.cmd" | |
$config = Get-Content $configPath -Raw | |
if(-not [string]::IsNullOrEmpty($JvmHeapArgs)) { | |
$config = $config.replace('set SOLR_JAVA_MEM', 'REM set SOLR_JAVA_MEM') | |
$config = "@set SOLR_JAVA_MEM=$JvmHeapArgs`n$config" | |
} | |
if(-not [string]::IsNullOrEmpty($JavaHome)) { | |
$config = "@set SOLR_JAVA_HOME=`"$JavaHome`"`n$config" | |
} | |
Set-Content $configPath $config | |
Write-Host "Restarting Solr to update config..." | |
Stop-Service solrJetty | |
Start-Service solrJetty | |
} | |
function Convert-SitecoreIndexNameToCoreName($sitecoreIndexName) { | |
$sitecoreIndexName -replace '^sitecore_(.*)_index', '$1' | |
} | |
function Create-SitecoreConfigSet($solrHomePath, $baseConfigSet, $schemaXmlPath, $sitecoreConfigSetName) { | |
$baseSetPath = Join-Path $solrHomePath "configsets\$baseConfigSet" -Resolve | |
$targetSetPath = Join-Path $solrHomePath "configsets\$sitecoreConfigSetName" | |
# Copy the base config set and install the Sitecore schema.xml | |
if(-not (Test-Path $targetSetPath)) { | |
Copy-Item $baseSetPath $targetSetPath -force -recurse | |
# Remove the managed schema file | |
Remove-Item "$targetSetPath\conf\managed-schema" -force -erroraction 'SilentlyContinue' | |
# Edit our Solr config | |
$config = [xml](Get-Content "$targetSetPath\conf\solrconfig.xml" -Raw) | |
# Disable managed schema | |
$schemaFactory = $config.config.schemaFactory | |
$schemaFactory.SetAttribute('class', 'ClassicIndexSchemaFactory') | |
$schemaFactory.InnerXml = '' | |
# Set max warming searchers | |
$config.config.query.maxWarmingSearchers = $MaxWarmingSearchers.ToString() | |
$config.Save("$targetSetPath\conf\solrconfig.xml") | |
# Deploy the Sitecore schema | |
Copy-Item $schemaXmlPath "$targetSetPath\conf\schema.xml" | |
Write-Host "Created $sitecoreConfigSetName Solr config set." | |
} else { | |
Write-Warning "Solr Config Set $sitecoreConfigSetName already existed. Leaving it alone." | |
} | |
} | |
function Create-SolrCore($solrBaseUrl, $coreName, $configSet) { | |
$restUrl = "{0}/admin/cores?action=CREATE&name={1}&configSet={2}" -f $solrBaseUrl, $coreName, $configSet | |
$result = Invoke-WebRequest $restUrl -Method GET -UseBasicParsing | |
Write-Host "Created Solr core $coreName." | |
} | |
function Create-SolrConfigPatch($indexNames, $nonSwitchOnRebuildIndexNames, $coreNamePrefix, $baseUrl) { | |
$xml = @" | |
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<settings> | |
<setting name="ContentSearch.Solr.ServiceBaseAddress"> | |
<patch:attribute name="value">{0}</patch:attribute> | |
</setting> | |
</settings> | |
<contentSearch> | |
<configuration> | |
<indexes> | |
"@ -f $baseUrl | |
$indexNames | % { | |
if($nonSwitchOnRebuildIndexNames -notcontains $_) { | |
$xml = $xml + @" | |
<index id="{0}"> | |
<patch:attribute name="type">Sitecore.ContentSearch.SolrProvider.SwitchOnRebuildSolrSearchIndex, Sitecore.ContentSearch.SolrProvider</patch:attribute> | |
<param desc="core">{1}_{2}</param> | |
<param desc="rebuildcore" patch:after="param[@desc='core']">{1}_{2}_2</param> | |
</index> | |
"@ -f $_, $coreNamePrefix, (Convert-SitecoreIndexNameToCoreName $_) | |
} else { # non-switch-on-rebuild index (e.g. analytics) | |
$xml = $xml + @" | |
<index id="{0}"> | |
<param desc="core">{1}_{2}</param> | |
</index> | |
"@ -f $_, $coreNamePrefix, (Convert-SitecoreIndexNameToCoreName $_) | |
} | |
} | |
$xml = $xml + @" | |
</indexes> | |
</configuration> | |
</contentSearch> | |
</sitecore> | |
</configuration> | |
"@ | |
$xml | |
} | |
$install = Read-Host "Do you need to install Solr on port $SolrPort, or is it already running? y/n" | |
if($install -eq 'y') { | |
Install-Solr $SolrInstallerPath $SolrPath $SolrPort | |
} | |
Create-SitecoreConfigSet -solrHomePath "$SolrHome" -baseConfigSet 'basic_configs' -schemaXmlPath "$PSScriptRoot\schema.xml" -sitecoreConfigSetName $SolrConfigSetName | |
$SitecoreIndexNames | % { | |
$index = Convert-SitecoreIndexNameToCoreName($_) | |
try { | |
Create-SolrCore $SolrBaseUrl "$($ProjectName)_$index" $SolrConfigSetName | |
if($SitecoreSingleIndexNames -notcontains $index) { | |
Create-SolrCore $SolrBaseUrl "$($ProjectName)_$($index)_2" $SolrConfigSetName | |
} | |
} catch { | |
Write-Warning "Unable to create core for $index index. This probably means it already exists. $_" | |
} | |
} | |
$patch = Create-SolrConfigPatch $SitecoreIndexNames $SitecoreSingleIndexNames $ProjectName $SolrBaseUrl | |
$patch > "$PSScriptRoot\Solr.config" | |
Write-Host "Created Sitecore patch file to configure indexes at $PSScriptRoot\Solr.config" | |
Write-Host "" | |
Write-Host "Next steps:" | |
Write-Host "* If you have not enabled and installed Solr assemblies and configs in Sitecore, do so." | |
Write-Host "* Install the generated $PSScriptRoot\Solr.config patch file to configure your cores and server target." | |
Write-Host "* If you need remote access to Solr, open port $SolrPort on Windows Firewall" | |
Write-Host "" | |
Write-Host "NOTE: Never run the Solr server on the public internet or expose the Solr port to the internet." | |
Write-Host "" | |
Write-Host "Opening Solr admin page in 8 seconds." | |
Start-Sleep -m 8000 | |
START $SolrBaseUrl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ErrorActionPreference = 'Stop' | |
function Install-BitnamiSolrWithDownload($rootPath, $port, $jvmHeapArgs = '-Xms512m -Xmx1024m', $javaHome) { | |
$SolrInstallExe = 'https://downloads.bitnami.com/files/stacks/solr/6.2.1-2/bitnami-solr-6.2.1-2-windows-installer.exe' | |
$ExpectedServiceName = 'solrJetty' | |
$service = Get-WmiObject win32_service | ?{$_.Name -eq $ExpectedServiceName} | select Name, PathName | |
if($service) { | |
Write-Host "Bitnami Solr Stack appears to already be installed (solrJetty service exists). Skipping installation." | |
return | |
} | |
Write-Host "Expected Solr windows service name $ExpectedServiceName was not found. Installing Solr..." | |
$SolrSetup = "$($env:TEMP)\solr.exe" | |
Write-Host "Downloading from $SolrInstallExe..." | |
(New-Object System.Net.WebClient).DownloadFile($SolrInstallExe, $SolrSetup) | |
Install-BitnamiSolr -InstallerPath $SolrSetup -RootPath $rootPath -Port $port -JvmHeapArgs $jvmHeapArgs -JavaHome $javaHome | |
} | |
function Install-BitnamiSolr($installerPath, $rootPath, $port, $jvmHeapArgs = '-Xms512m -Xmx1024m', $javaHome) { | |
Write-Host "Installing Solr on port $port..." | |
$apachePort = [int]$port + 2 | |
$apacheSslPort = [int]$port + 3 | |
$solrStopPort = [int]$port + 1 | |
& $installerPath --unattendedmodeui minimal --mode unattended --prefix $rootPath --apache_server_port $apachePort --apache_server_ssl_port $apacheSslPort --apache_solr_port $port --apache_solr_stop_port $solrStopPort --launch_cloud 0 --base_user "fake" --base_password "fake" | |
# Bitnami returns immediately and we have to wait till it's done installing | |
Write-Host 'Waiting for Solr install to complete...' | |
Wait-Process -Name solr | |
if($LASTEXITCODE -gt 7) { | |
throw "Solr installer $installerPath failed with exit code $LASTEXITCODE" | |
} | |
Write-Host 'Configuring Solr...' | |
$configPath = "$rootPath\apache-solr\bin\solr.in.cmd" | |
if(-not (Test-Path $configPath)) { | |
throw "$configPath did not exist. This probably means Solr did not install correctly." | |
} | |
$config = Get-Content $configPath -Raw | |
if(-not [string]::IsNullOrEmpty($jvmHeapArgs)) { | |
$config = $config.replace('set SOLR_JAVA_MEM', 'REM set SOLR_JAVA_MEM') | |
$config = "@set SOLR_JAVA_MEM=$jvmHeapArgs`n$config" | |
} | |
if(-not [string]::IsNullOrEmpty($javaHome)) { | |
$config = "@set SOLR_JAVA_HOME=`"$javaHome`"`n$config" | |
} | |
Set-Content $configPath $config | |
Write-Host "Restarting Solr to update config..." | |
Write-Host "Note: if you have more than one local Solr server, you may need to restart the correct service manually." | |
try { | |
Stop-Service solrJetty | |
} | |
finally { | |
# just in case the stop didn't take :D | |
kill -name java -force -ErrorAction SilentlyContinue | |
} | |
Start-Service solrJetty | |
} | |
Export-ModuleMember Install-BitnamiSolr | |
Export-ModuleMember Install-BitnamiSolrWithDownload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and | |
limitations under the License. | |
--> | |
<!-- | |
This is the Solr schema file. This file should be named "schema.xml" and | |
should be in the conf directory under the solr home | |
(i.e. ./solr/conf/schema.xml by default) | |
or located where the classloader for the Solr webapp can find it. | |
This example schema is the recommended starting point for users. | |
It should be kept correct and concise, usable out-of-the-box. | |
For more information, on how to customize this file, please see | |
http://wiki.apache.org/solr/SchemaXml | |
--> | |
<schema name="Sitecore81u1" version="1.6"> | |
<fields> | |
<field name="_content" type="text_general" indexed="true" stored="false" /> | |
<field name="_database" type="string" indexed="true" stored="true" /> | |
<field name="_path" type="string" indexed="true" stored="false" multiValued="true" /> | |
<field name="_uniqueid" type="string" indexed="true" stored="true" required="true" /> | |
<field name="_datasource" type="string" indexed="true" stored="true" required="true" /> | |
<field name="_parent" type="string" indexed="true" stored="true" /> | |
<field name="_name" type="text_general" indexed="true" stored="true" /> | |
<field name="_displayname" type="text_general" indexed="true" stored="true" /> | |
<field name="_language" type="string" indexed="true" stored="true" /> | |
<field name="_creator" type="lowercase" indexed="true" stored="true" /> | |
<field name="_editor" type="lowercase" indexed="true" stored="true" /> | |
<field name="_created" type="tdate" indexed="true" stored="true" /> | |
<field name="_updated" type="tdate" indexed="true" stored="true" /> | |
<field name="_hidden" type="boolean" indexed="true" stored="false" /> | |
<field name="_template" type="string" indexed="true" stored="true" /> | |
<field name="_templatename" type="string" indexed="true" stored="true" /> | |
<field name="_templates" type="string" indexed="true" stored="true" multiValued="true" /> | |
<field name="_icon" type="string" indexed="true" stored="true" /> | |
<field name="_links" type="string" indexed="true" stored="true" multiValued="true" /> | |
<field name="_tags" type="string" indexed="true" stored="true" multiValued="true" /> | |
<field name="_group" type="string" indexed="true" stored="true" /> | |
<field name="_indexname" type="string" indexed="true" stored="true" /> | |
<field name="_latestversion" type="boolean" indexed="true" stored="true" /> | |
<field name="_indextimestamp" type="tdate" indexed="true" stored="true" default="NOW" /> | |
<field name="_fullpath" type="string" indexed="true" stored="true" /> | |
<field name="_isclone" type="boolean" indexed="true" stored="true" /> | |
<field name="_version" type="string" indexed="true" stored="true" /> | |
<field name="_hash" type="string" indexed="true" stored="true" /> | |
<field name="__semantics" type="string" indexed="true" stored="true" multiValued="true" /> | |
<field name="__bucketable" type="boolean" indexed="true" stored="false" /> | |
<field name="__workflow_state" type="string" indexed="true" stored="false" /> | |
<field name="__is_bucket" type="boolean" indexed="true" stored="false" /> | |
<field name="lock" type="boolean" indexed="true" stored="false" /> | |
<field name="is_displayed_in_search_results" type="boolean" indexed="true" stored="false" /> | |
<field name="text" type="text_general" indexed="true" stored="false" multiValued="true" /> | |
<field name="text_rev" type="text_general_rev" indexed="true" stored="false" multiValued="true" /> | |
<field name="alphaNameSort" type="alphaOnlySort" indexed="true" stored="false" /> | |
<field name="__hidden" type="boolean" indexed="true" stored="false" /> | |
<field name="_version_" type="long" indexed="true" stored="true" /> | |
<dynamicField name="*_t" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ab" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_aa" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_af" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ak" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_sq" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_am" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ar" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_an" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_hy" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_as" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_av" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ae" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ay" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_az" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_bm" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ba" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_eu" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_be" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_bn" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_bh" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_bi" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_bs" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_br" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_bg" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_my" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ca" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ch" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ce" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ny" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_zh" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_cv" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_kw" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_co" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_cr" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_hr" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_cs" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_da" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_dv" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_nl" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_dz" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_en" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_eo" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_et" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ee" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_fo" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_fj" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_fi" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_fr" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ff" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_gl" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ka" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_de" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_el" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_gn" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_gu" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ht" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ha" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_he" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_hz" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_hi" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ho" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_hu" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ia" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_id" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ie" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ga" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ig" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ik" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_io" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_is" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_it" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_iu" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ja" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_jv" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_kl" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_kn" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_kr" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ks" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_kk" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_km" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ki" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_rw" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ky" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_kv" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_kg" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ko" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ku" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_kj" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_la" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_lb" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_lg" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_li" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ln" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_lo" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_lt" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_lu" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_lv" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_gv" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_mk" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_mg" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ms" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ml" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_mt" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_mi" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_mr" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_mh" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_mn" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_na" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_nv" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_nd" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ne" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ng" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_nb" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_nn" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_no" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ii" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_nr" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_oc" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_oj" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_cu" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_om" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_or" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_os" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_pa" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_pi" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_fa" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_pl" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ps" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_pt" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_qu" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_rm" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_rn" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ro" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ru" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_sa" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_sc" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_sd" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_se" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_sm" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_sg" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_sr" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_gd" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_sn" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_si" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_sk" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_sl" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_so" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_st" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_es" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_su" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_sw" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ss" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_sv" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ta" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_te" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_tg" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_th" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ti" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_bo" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_tk" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_tl" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_tn" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_to" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_tr" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ts" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_tt" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_tw" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ty" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ug" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_uk" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ur" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_uz" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_ve" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_vi" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_vo" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_wa" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_cy" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_wo" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_fy" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_xh" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_yi" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_yo" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_za" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_t_zu" type="text_general" indexed="true" stored="true" /> | |
<dynamicField name="*_i" type="int" indexed="true" stored="true" /> | |
<dynamicField name="*_s" type="string" indexed="true" stored="true" /> | |
<dynamicField name="*_sm" type="string" indexed="true" stored="true" multiValued="true" /> | |
<dynamicField name="*_im" type="int" indexed="true" stored="true" multiValued="true" /> | |
<dynamicField name="*_b" type="boolean" indexed="true" stored="true" /> | |
<dynamicField name="*_dt" type="date" indexed="true" stored="true" /> | |
<dynamicField name="*_p" type="location" indexed="true" stored="true" /> | |
<dynamicField name="*_ti" type="tint" indexed="true" stored="true" /> | |
<dynamicField name="*_tl" type="tlong" indexed="true" stored="true" /> | |
<dynamicField name="*_tf" type="tfloat" indexed="true" stored="true" /> | |
<dynamicField name="*_td" type="tdouble" indexed="true" stored="true" /> | |
<dynamicField name="*_tdt" type="tdate" indexed="true" stored="true" /> | |
<dynamicField name="*_tdtm" type="tdate" indexed="true" stored="true" multiValued="true" /> | |
<dynamicField name="*_pi" type="tint" indexed="true" stored="true" /> | |
<dynamicField name="*_c" type="currency" indexed="true" stored="true" /> | |
<dynamicField name="*_ignored" type="ignored" indexed="true" stored="true" /> | |
<dynamicField name="*_random" type="random" indexed="true" stored="true" /> | |
</fields> | |
<uniqueKey>_uniqueid</uniqueKey> | |
<types> | |
<fieldType name="string" class="solr.StrField" sortMissingLast="true" /> | |
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" /> | |
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0" /> | |
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0" /> | |
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0" /> | |
<fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0" /> | |
<fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0" /> | |
<fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0" /> | |
<fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0" /> | |
<fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0" /> | |
<fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0" /> | |
<fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0" /> | |
<fieldType name="binary" class="solr.BinaryField" /> | |
<fieldType name="random" class="solr.RandomSortField" indexed="true" /> | |
<fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100"> | |
<analyzer> | |
<tokenizer class="solr.WhitespaceTokenizerFactory" /> | |
</analyzer> | |
</fieldType> | |
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100"> | |
<analyzer type="index"> | |
<tokenizer class="solr.StandardTokenizerFactory" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
</analyzer> | |
<analyzer type="query"> | |
<tokenizer class="solr.StandardTokenizerFactory" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> | |
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
</analyzer> | |
</fieldType> | |
<fieldType name="text_en" class="solr.TextField" positionIncrementGap="100"> | |
<analyzer type="index"> | |
<tokenizer class="solr.StandardTokenizerFactory" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
<filter class="solr.EnglishPossessiveFilterFactory" /> | |
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt" /> | |
<filter class="solr.PorterStemFilterFactory" /> | |
</analyzer> | |
<analyzer type="query"> | |
<tokenizer class="solr.StandardTokenizerFactory" /> | |
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
<filter class="solr.EnglishPossessiveFilterFactory" /> | |
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt" /> | |
<filter class="solr.PorterStemFilterFactory" /> | |
</analyzer> | |
</fieldType> | |
<fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true"> | |
<analyzer type="index"> | |
<tokenizer class="solr.WhitespaceTokenizerFactory" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt" /> | |
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt" /> | |
<filter class="solr.PorterStemFilterFactory" /> | |
</analyzer> | |
<analyzer type="query"> | |
<tokenizer class="solr.WhitespaceTokenizerFactory" /> | |
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt" /> | |
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt" /> | |
<filter class="solr.PorterStemFilterFactory" /> | |
</analyzer> | |
</fieldType> | |
<fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true"> | |
<analyzer> | |
<tokenizer class="solr.WhitespaceTokenizerFactory" /> | |
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt" /> | |
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt" /> | |
<filter class="solr.EnglishMinimalStemFilterFactory" /> | |
<filter class="solr.RemoveDuplicatesTokenFilterFactory" /> | |
</analyzer> | |
</fieldType> | |
<fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100"> | |
<analyzer type="index"> | |
<tokenizer class="solr.StandardTokenizerFactory" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
<filter class="solr.ReversedWildcardFilterFactory" withOriginal="true" maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33" /> | |
</analyzer> | |
<analyzer type="query"> | |
<tokenizer class="solr.StandardTokenizerFactory" /> | |
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
</analyzer> | |
</fieldType> | |
<fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true"> | |
<analyzer> | |
<tokenizer class="solr.KeywordTokenizerFactory" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
<filter class="solr.TrimFilterFactory" /> | |
<filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z])" replacement="" replace="all" /> | |
</analyzer> | |
</fieldType> | |
<fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100"> | |
<analyzer> | |
<tokenizer class="solr.KeywordTokenizerFactory" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
</analyzer> | |
</fieldType> | |
<fieldType name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" /> | |
<fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d" /> | |
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate" /> | |
<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType" geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" /> | |
<fieldType name="bbox" class="solr.BBoxField" geo="true" distanceUnits="kilometers" numberType="_bbox_coord" /> | |
<fieldType name="_bbox_coord" class="solr.TrieDoubleField" precisionStep="8" docValues="true" stored="false" /> | |
<fieldType name="currency" class="solr.CurrencyField" precisionStep="8" defaultCurrency="USD" currencyConfig="currency.xml" /> | |
<fieldType name="pint" class="solr.TrieIntField" /> | |
</types> | |
</schema> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment