b2332aa02f50b51cc83407f8e8aeaff8e1e53663
[prawokultury.git] / doc / solr-conf / schema.xml
1 <?xml version="1.0" ?>
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 <schema name="default" version="1.4">
20   <types>
21     <fieldtype name="string"  class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
22     <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
23     <fieldtype name="binary" class="solr.BinaryField"/>
24
25     <!-- Numeric field types that manipulate the value into
26          a string value that isn't human-readable in its internal form,
27          but with a lexicographic ordering the same as the numeric ordering,
28          so that range queries work correctly. -->
29     <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
30     <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
31     <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
32     <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
33
34     <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
35     <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
36     <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
37     <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
38
39     <fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0"/>
40     <!-- A Trie based date field for faster date range queries and date faceting. -->
41     <fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
42
43     <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
44     <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
45     <fieldtype name="geohash" class="solr.GeoHashField"/>
46
47     <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
48       <analyzer type="index">
49         <tokenizer class="solr.StandardTokenizerFactory"/>
50         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
51         <!-- in this example, we will only use synonyms at query time
52         <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
53         -->
54         <filter class="solr.LowerCaseFilterFactory"/>
55       </analyzer>
56       <analyzer type="query">
57         <tokenizer class="solr.StandardTokenizerFactory"/>
58         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
59         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
60         <filter class="solr.LowerCaseFilterFactory"/>
61       </analyzer>
62     </fieldType>
63
64
65     <fieldType name="text_pl" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
66       <analyzer> 
67         <tokenizer class="solr.StandardTokenizerFactory"/>
68         <filter class="solr.LowerCaseFilterFactory"/>
69         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pl.txt" format="snowball" enablePositionIncrements="true"/>
70         <filter class="solr.MorfologikFilterFactory" dictionary="MORFOLOGIK" />
71         <!-- less aggressive: <filter class="solr.PortugueseMinimalStemFilterFactory"/> -->
72         <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Portuguese"/> -->
73         <!-- most aggressive: <filter class="solr.PortugueseStemFilterFactory"/> -->
74       </analyzer>
75     </fieldType>
76
77     <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
78       <analyzer type="index">
79         <tokenizer class="solr.StandardTokenizerFactory"/>
80         <filter class="solr.StopFilterFactory"
81                 ignoreCase="true"
82                 words="stopwords_en.txt"
83                 enablePositionIncrements="true"
84                 />
85         <filter class="solr.LowerCaseFilterFactory"/>
86         <filter class="solr.EnglishPossessiveFilterFactory"/>
87         <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
88         <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
89           <filter class="solr.EnglishMinimalStemFilterFactory"/>
90         -->
91         <filter class="solr.PorterStemFilterFactory"/>
92       </analyzer>
93       <analyzer type="query">
94         <tokenizer class="solr.StandardTokenizerFactory"/>
95         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
96         <filter class="solr.StopFilterFactory"
97                 ignoreCase="true"
98                 words="stopwords_en.txt"
99                 enablePositionIncrements="true"
100                 />
101         <filter class="solr.LowerCaseFilterFactory"/>
102         <filter class="solr.EnglishPossessiveFilterFactory"/>
103         <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
104         <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
105           <filter class="solr.EnglishMinimalStemFilterFactory"/>
106         -->
107         <filter class="solr.PorterStemFilterFactory"/>
108       </analyzer>
109     </fieldType>
110
111     <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
112       <analyzer>
113         <tokenizer class="solr.WhitespaceTokenizerFactory"/>
114       </analyzer>
115     </fieldType>
116
117     <fieldType name="ngram" class="solr.TextField" >
118       <analyzer type="index">
119         <tokenizer class="solr.KeywordTokenizerFactory"/>
120         <filter class="solr.LowerCaseFilterFactory"/>
121         <filter class="solr.NGramFilterFactory" minGramSize="3" maxGramSize="15" />
122       </analyzer>
123       <analyzer type="query">
124         <tokenizer class="solr.KeywordTokenizerFactory"/>
125         <filter class="solr.LowerCaseFilterFactory"/>
126       </analyzer>
127     </fieldType>
128
129     <fieldType name="edge_ngram" class="solr.TextField" positionIncrementGap="1">
130       <analyzer type="index">
131         <tokenizer class="solr.WhitespaceTokenizerFactory" />
132         <filter class="solr.LowerCaseFilterFactory" />
133         <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
134         <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front" />
135       </analyzer>
136       <analyzer type="query">
137         <tokenizer class="solr.WhitespaceTokenizerFactory" />
138         <filter class="solr.LowerCaseFilterFactory" />
139         <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
140       </analyzer>
141     </fieldType>
142   </types>
143
144   <fields>
145     <!-- general -->
146     <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
147     <field name="django_ct" type="string" indexed="true" stored="true" multiValued="false"/>
148     <field name="django_id" type="string" indexed="true" stored="true" multiValued="false"/>
149
150     <dynamicField name="*_i"  type="int"    indexed="true"  stored="true"/>
151     <dynamicField name="*_s"  type="string"  indexed="true"  stored="true"/>
152     <dynamicField name="*_l"  type="long"   indexed="true"  stored="true"/>
153     <dynamicField name="*_t"  type="text_en"    indexed="true"  stored="true"/>
154     <dynamicField name="*_b"  type="boolean" indexed="true"  stored="true"/>
155     <dynamicField name="*_f"  type="float"  indexed="true"  stored="true"/>
156     <dynamicField name="*_d"  type="double" indexed="true"  stored="true"/>
157     <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
158     <dynamicField name="*_p" type="location" indexed="true" stored="true"/>
159     <dynamicField name="*_coordinate"  type="tdouble" indexed="true"  stored="false"/>
160     <dynamicField name="*_pl" type="text_pl" indexed="true" stored="false" />
161     <dynamicField name="*_en" type="text_en" indexed="true" stored="false" />
162
163     <field name="author" type="text_ws" indexed="true" stored="true" multiValued="false" />
164     <field name="date" type="date" indexed="true" stored="true" multiValued="false" />
165     <field name="body_pl" type="text_pl" indexed="true" stored="true" multiValued="false" />
166     <field name="title_pl" type="text_pl" indexed="true" stored="true" multiValued="false" />
167     <field name="lead_pl" type="text_pl" indexed="true" stored="true" multiValued="false" />
168     <field name="lead_en" type="text_en" indexed="true" stored="true" multiValued="false" />
169     <field name="title_en" type="text_en" indexed="true" stored="true" multiValued="false" />
170     <field name="body_en" type="text_en" indexed="true" stored="true" multiValued="false" />
171
172   </fields>
173
174   <!-- field to use to determine and enforce document uniqueness. -->
175   <uniqueKey>id</uniqueKey>
176
177   <!-- field for the QueryParser to use when an explicit fieldname is absent -->
178   <defaultSearchField>body_pl</defaultSearchField>
179
180   <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
181   <solrQueryParser defaultOperator="AND"/>
182 </schema>
183