Skip to content

Instantly share code, notes, and snippets.

@kritik
Created November 4, 2011 19:31
Show Gist options
  • Save kritik/1340264 to your computer and use it in GitHub Desktop.
Save kritik/1340264 to your computer and use it in GitHub Desktop.
tomcat-pruction solr config
<?xml version="1.0" encoding="UTF-8" ?>
<!-- from jetty-solr https://github.com/dcrec1/jetty-solr/blob/master/solr/conf/schema.xml -->
<!--
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="acts_as_solr" version="0.9">
<types>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="false"/>
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="false"/>
<fieldType name="integer" class="solr.IntField" omitNorms="false"/>
<fieldType name="long" class="solr.LongField" omitNorms="false"/>
<fieldType name="float" class="solr.FloatField" omitNorms="false"/>
<fieldType name="double" class="solr.DoubleField" omitNorms="false"/>
<fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="false"/>
<fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="false"/>
<fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="false"/>
<fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="false"/>
<fieldType name="date" class="solr.DateField" sortMissingLast="true" omitNorms="false"/>
<fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
</analyzer>
</fieldType>
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
<charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
</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="stopwords.txt"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
<charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
</analyzer>
</fieldType>
<fieldType name="textTight" class="solr.TextField" positionIncrementGap="100" >
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
<charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
</analyzer>
</fieldType>
<fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="false">
<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="text_zh" class="solr.TextField">
<analyzer class="org.apache.lucene.analysis.cn.ChineseAnalyzer"/>
</fieldtype>
<fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" >
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
<charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
</analyzer>
</fieldType>
</types>
<fields>
<field name="id" type="string" indexed="true" stored="true" required="true" />
<field name="pk_i" type="integer" indexed="true" stored="true"/>
<field name="pk_s" type="string" indexed="true" stored="true"/>
<field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
<field name="spell" type="textSpell" indexed="true" stored="true" multiValued="true"/>
<dynamicField name="*_i" type="integer" indexed="true" stored="false"/>
<dynamicField name="*_t" type="text" indexed="true" stored="true"/>
<dynamicField name="*_f" type="float" indexed="true" stored="false"/>
<dynamicField name="*_b" type="boolean" indexed="true" stored="false"/>
<dynamicField name="*_d" type="date" indexed="true" stored="false"/>
<dynamicField name="*_s" type="string" indexed="true" stored="false"/>
<dynamicField name="*_ri" type="sint" indexed="true" stored="false"/>
<dynamicField name="*_rf" type="sfloat" indexed="true" stored="false"/>
<dynamicField name="*_facet" type="string" indexed="true" stored="false"/>
<dynamicField name="*_s_mv" type="string" indexed="true" stored="false" multiValued="true"/>
<dynamicField name="*_zh_text" type="text_zh" indexed="true" stored="false" multiValued="true"/>
<dynamicField name="*_display" type="text" indexed="false" stored="true" multiValued="true"/>
<field name="lat" type="sdouble" indexed="true" stored="true"/><!-- must match the latField in solrconfig.xml -->
<field name="lng" type="sdouble" indexed="true" stored="true"/><!-- must match the lngField in solrconfig.xml -->
<field name="geo_distance" type="sdouble"/> <!-- Optional but used for distributed searching -->
<dynamicField name="_local*" type="sdouble" indexed="true" stored="true"/><!-- used internally by localsolr -->
</fields>
<uniqueKey>id</uniqueKey>
<defaultSearchField>text</defaultSearchField>
<copyField source="*_t" dest="text"/>
<copyField source="*_facet" dest="text"/>
<copyField source="*_t" dest="spell"/>
<copyField source="*_facet" dest="spell"/>
<solrQueryParser defaultOperator="AND"/>
</schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment