| 1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|---|
| 2 |
<!-- |
|---|
| 3 |
Licensed to the Apache Software Foundation (ASF) under one or more |
|---|
| 4 |
contributor license agreements. See the NOTICE file distributed with |
|---|
| 5 |
this work for additional information regarding copyright ownership. |
|---|
| 6 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
|---|
| 7 |
(the "License"); you may not use this file except in compliance with |
|---|
| 8 |
the License. You may obtain a copy of the License at |
|---|
| 9 |
|
|---|
| 10 |
http://www.apache.org/licenses/LICENSE-2.0 |
|---|
| 11 |
|
|---|
| 12 |
Unless required by applicable law or agreed to in writing, software |
|---|
| 13 |
distributed under the License is distributed on an "AS IS" BASIS, |
|---|
| 14 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|---|
| 15 |
See the License for the specific language governing permissions and |
|---|
| 16 |
limitations under the License. |
|---|
| 17 |
--> |
|---|
| 18 |
|
|---|
| 19 |
<!-- |
|---|
| 20 |
This is the Solr schema file. This file should be named "schema.xml" and |
|---|
| 21 |
should be in the conf directory under the solr home |
|---|
| 22 |
(i.e. ./solr/conf/schema.xml by default) |
|---|
| 23 |
or located where the classloader for the Solr webapp can find it. |
|---|
| 24 |
|
|---|
| 25 |
This example schema is the recommended starting point for users. |
|---|
| 26 |
It should be kept correct and concise, usable out-of-the-box. |
|---|
| 27 |
|
|---|
| 28 |
For more information, on how to customize this file, please see |
|---|
| 29 |
http://wiki.apache.org/solr/SchemaXml |
|---|
| 30 |
--> |
|---|
| 31 |
|
|---|
| 32 |
<schema name="acts_as_solr" version="0.9"> |
|---|
| 33 |
<types> |
|---|
| 34 |
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="false"/> |
|---|
| 35 |
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="false"/> |
|---|
| 36 |
<fieldType name="integer" class="solr.IntField" omitNorms="false"/> |
|---|
| 37 |
<fieldType name="long" class="solr.LongField" omitNorms="false"/> |
|---|
| 38 |
<fieldType name="float" class="solr.FloatField" omitNorms="false"/> |
|---|
| 39 |
<fieldType name="double" class="solr.DoubleField" omitNorms="false"/> |
|---|
| 40 |
<fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="false"/> |
|---|
| 41 |
<fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="false"/> |
|---|
| 42 |
<fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="false"/> |
|---|
| 43 |
<fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="false"/> |
|---|
| 44 |
<fieldType name="date" class="solr.DateField" sortMissingLast="true" omitNorms="false"/> |
|---|
| 45 |
<fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100"> |
|---|
| 46 |
<analyzer> |
|---|
| 47 |
<tokenizer class="solr.WhitespaceTokenizerFactory"/> |
|---|
| 48 |
</analyzer> |
|---|
| 49 |
</fieldType> |
|---|
| 50 |
|
|---|
| 51 |
<fieldType name="text" class="solr.TextField" positionIncrementGap="100"> |
|---|
| 52 |
<analyzer type="index"> |
|---|
| 53 |
<tokenizer class="solr.WhitespaceTokenizerFactory"/> |
|---|
| 54 |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> |
|---|
| 55 |
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0"/> |
|---|
| 56 |
<filter class="solr.LowerCaseFilterFactory"/> |
|---|
| 57 |
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/> |
|---|
| 58 |
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/> |
|---|
| 59 |
</analyzer> |
|---|
| 60 |
<analyzer type="query"> |
|---|
| 61 |
<tokenizer class="solr.WhitespaceTokenizerFactory"/> |
|---|
| 62 |
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> |
|---|
| 63 |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> |
|---|
| 64 |
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0"/> |
|---|
| 65 |
<filter class="solr.LowerCaseFilterFactory"/> |
|---|
| 66 |
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/> |
|---|
| 67 |
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/> |
|---|
| 68 |
</analyzer> |
|---|
| 69 |
</fieldType> |
|---|
| 70 |
|
|---|
| 71 |
<fieldType name="textTight" class="solr.TextField" positionIncrementGap="100" > |
|---|
| 72 |
<analyzer> |
|---|
| 73 |
<tokenizer class="solr.WhitespaceTokenizerFactory"/> |
|---|
| 74 |
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/> |
|---|
| 75 |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> |
|---|
| 76 |
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/> |
|---|
| 77 |
<filter class="solr.LowerCaseFilterFactory"/> |
|---|
| 78 |
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/> |
|---|
| 79 |
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/> |
|---|
| 80 |
</analyzer> |
|---|
| 81 |
</fieldType> |
|---|
| 82 |
|
|---|
| 83 |
<fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="false"> |
|---|
| 84 |
<analyzer> |
|---|
| 85 |
<tokenizer class="solr.KeywordTokenizerFactory"/> |
|---|
| 86 |
<filter class="solr.LowerCaseFilterFactory" /> |
|---|
| 87 |
<filter class="solr.TrimFilterFactory" /> |
|---|
| 88 |
<filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z])" replacement="" replace="all"/> |
|---|
| 89 |
</analyzer> |
|---|
| 90 |
</fieldType> |
|---|
| 91 |
|
|---|
| 92 |
<fieldtype name="text_zh" class="solr.TextField"> |
|---|
| 93 |
<analyzer class="org.apache.lucene.analysis.cn.ChineseAnalyzer"/> |
|---|
| 94 |
</fieldtype> |
|---|
| 95 |
|
|---|
| 96 |
</types> |
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
<fields> |
|---|
| 100 |
<field name="id" type="string" indexed="true" stored="true" required="true" /> |
|---|
| 101 |
<field name="pk_i" type="integer" indexed="true" stored="true"/> |
|---|
| 102 |
<field name="pk_s" type="string" indexed="true" stored="true"/> |
|---|
| 103 |
<field name="text" type="text" indexed="true" stored="false" multiValued="true"/> |
|---|
| 104 |
|
|---|
| 105 |
<dynamicField name="*_i" type="integer" indexed="true" stored="false"/> |
|---|
| 106 |
<dynamicField name="*_t" type="text" indexed="true" stored="false"/> |
|---|
| 107 |
<dynamicField name="*_f" type="float" indexed="true" stored="false"/> |
|---|
| 108 |
<dynamicField name="*_b" type="boolean" indexed="true" stored="false"/> |
|---|
| 109 |
<dynamicField name="*_d" type="date" indexed="true" stored="false"/> |
|---|
| 110 |
<dynamicField name="*_s" type="string" indexed="true" stored="false"/> |
|---|
| 111 |
<dynamicField name="*_ri" type="sint" indexed="true" stored="false"/> |
|---|
| 112 |
<dynamicField name="*_rf" type="sfloat" indexed="true" stored="false"/> |
|---|
| 113 |
<dynamicField name="*_facet" type="string" indexed="true" stored="false"/> |
|---|
| 114 |
<dynamicField name="*_s_mv" type="string" indexed="true" stored="false" multiValued="true"/> |
|---|
| 115 |
<dynamicField name="*_zh_text" type="text_zh" indexed="true" stored="false" multiValued="true"/> |
|---|
| 116 |
<dynamicField name="*_display" type="text" indexed="false" stored="true" multiValued="true"/> |
|---|
| 117 |
</fields> |
|---|
| 118 |
|
|---|
| 119 |
<uniqueKey>id</uniqueKey> |
|---|
| 120 |
<defaultSearchField>text</defaultSearchField> |
|---|
| 121 |
|
|---|
| 122 |
<copyField source="*_t" dest="text"/> |
|---|
| 123 |
<copyField source="*_facet" dest="text"/> |
|---|
| 124 |
<solrQueryParser defaultOperator="AND"/> |
|---|
| 125 |
|
|---|
| 126 |
</schema> |
|---|