Skip to content
This repository
Newer
Older
100644 251 lines (214 sloc) 12.971 kb
deaf247b »
2010-11-11 Big refactor, reuters demo, facet fixes
1 <schema name="reuters" version="1.1">
2 <types>
3 <!-- field type definitions. The "name" attribute is
4 just a label to be used by field definitions. The "class"
5 attribute and any other attributes determine the real
6 behavior of the fieldType.
7 Class names starting with "solr" refer to java classes in the
8 org.apache.solr.analysis package.
9 -->
10
11 <!-- The StrField type is not analyzed, but indexed/stored verbatim.
12 - StrField and TextField support an optional compressThreshold which
13 limits compression (if enabled in the derived fields) to values which
14 exceed a certain size (in characters).
15 -->
16 <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
17
18 <!-- boolean type: "true" or "false" -->
19 <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
20
21 <!-- The optional sortMissingLast and sortMissingFirst attributes are
22 currently supported on types that are sorted internally as strings.
23 - If sortMissingLast="true", then a sort on this field will cause documents
24 without the field to come after documents with the field,
25 regardless of the requested sort order (asc or desc).
26 - If sortMissingFirst="true", then a sort on this field will cause documents
27 without the field to come before documents with the field,
28 regardless of the requested sort order.
29 - If sortMissingLast="false" and sortMissingFirst="false" (the default),
30 then default lucene sorting will be used which places docs without the
31 field first in an ascending sort and last in a descending sort.
32 -->
33
34
35 <!-- numeric field types that store and index the text
36 value verbatim (and hence don't support range queries, since the
37 lexicographic ordering isn't equal to the numeric ordering) -->
38 <fieldType name="integer" class="solr.IntField" omitNorms="true"/>
39 <fieldType name="long" class="solr.LongField" omitNorms="true"/>
40 <fieldType name="float" class="solr.FloatField" omitNorms="true"/>
41 <fieldType name="double" class="solr.DoubleField" omitNorms="true"/>
42
43
44 <!-- Numeric field types that manipulate the value into
45 a string value that isn't human-readable in its internal form,
46 but with a lexicographic ordering the same as the numeric ordering,
47 so that range queries work correctly. -->
48 <fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
49 <fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
50 <fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
51 <fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>
52
53
54 <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
55 is a more restricted form of the canonical representation of dateTime
56 http://www.w3.org/TR/xmlschema-2/#dateTime
57 The trailing "Z" designates UTC time and is mandatory.
58 Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
59 All other components are mandatory.
60
61 Expressions can also be used to denote calculations that should be
62 performed relative to "NOW" to determine the value, ie...
63
64 NOW/HOUR
65 ... Round to the start of the current hour
66 NOW-1DAY
67 ... Exactly 1 day prior to now
68 NOW/DAY+6MONTHS+3DAYS
69 ... 6 months and 3 days in the future from the start of
70 the current day
71
72 Consult the DateField javadocs for more information.
73 -->
74 <fieldType name="date" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>
75
76
77 <!-- The "RandomSortField" is not used to store or search any
78 data. You can declare fields of this type it in your schema
79 to generate psuedo-random orderings of your docs for sorting
80 purposes. The ordering is generated based on the field name
81 and the version of the index, As long as the index version
82 remains unchanged, and the same field name is reused,
83 the ordering of the docs will be consistent.
84 If you want differend psuedo-random orderings of documents,
85 for the same version of the index, use a dynamicField and
86 change the name
87 -->
88 <fieldType name="random" class="solr.RandomSortField" indexed="true" />
89
90 <!-- solr.TextField allows the specification of custom text analyzers
91 specified as a tokenizer and a list of token filters. Different
92 analyzers may be specified for indexing and querying.
93
94 The optional positionIncrementGap puts space between multiple fields of
95 this type on the same document, with the purpose of preventing false phrase
96 matching across fields.
97
98 For more info on customizing your analyzer chain, please see
99 http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
100 -->
101
102 <!-- One can also specify an existing Analyzer class that has a
103 default constructor via the class attribute on the analyzer element
104 <fieldType name="text_greek" class="solr.TextField">
105 <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
106 </fieldType>
107 -->
108
109 <!-- A text field that only splits on whitespace for exact matching of words -->
110 <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
111 <analyzer>
112 <tokenizer class="solr.WhitespaceTokenizerFactory"/>
113 </analyzer>
114 </fieldType>
115
116 <!-- A text field that uses WordDelimiterFilter to enable splitting and matching of
117 words on case-change, alpha numeric boundaries, and non-alphanumeric chars,
118 so that a query of "wifi" or "wi fi" could match a document containing "Wi-Fi".
119 Synonyms and stopwords are customized by external files, and stemming is enabled.
120 Duplicate tokens at the same position (which may result from Stemmed Synonyms or
121 WordDelim parts) are removed.
122 -->
123 <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
124 <analyzer type="index">
125 <tokenizer class="solr.WhitespaceTokenizerFactory"/>
126 <!-- in this example, we will only use synonyms at query time
127 <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
128 -->
129 <!-- Case insensitive stop word removal.
130 enablePositionIncrements=true ensures that a 'gap' is left to
131 allow for accurate phrase queries.
132 -->
133 <filter class="solr.StopFilterFactory"
134 ignoreCase="true"
135 words="stopwords.txt"
136 enablePositionIncrements="true"
137 />
138 <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
139 <filter class="solr.LowerCaseFilterFactory"/>
140 <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
141 <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
142 </analyzer>
143 <analyzer type="query">
144 <tokenizer class="solr.WhitespaceTokenizerFactory"/>
145 <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
146 <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
147 <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
148 <filter class="solr.LowerCaseFilterFactory"/>
149 <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
150 <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
151 </analyzer>
152 </fieldType>
153
154
155 <!-- Less flexible matching, but less false matches. Probably not ideal for product names,
156 but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
157 <fieldType name="textTight" class="solr.TextField" positionIncrementGap="100" >
158 <analyzer>
159 <tokenizer class="solr.WhitespaceTokenizerFactory"/>
160 <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
161 <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
162 <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
163 <filter class="solr.LowerCaseFilterFactory"/>
164 <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
165 <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
166 </analyzer>
167 </fieldType>
168
169
170 <!--
171 Setup simple analysis for spell checking
172 -->
173 <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" >
174 <analyzer>
175 <tokenizer class="solr.StandardTokenizerFactory"/>
176 <filter class="solr.LowerCaseFilterFactory"/>
177 <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
178 </analyzer>
179 </fieldType>
180
181 <!-- This is an example of using the KeywordTokenizer along
182 With various TokenFilterFactories to produce a sortable field
183 that does not include some properties of the source text
184 -->
185 <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
186 <analyzer>
187 <!-- KeywordTokenizer does no actual tokenizing, so the entire
188 input string is preserved as a single token
189 -->
190 <tokenizer class="solr.KeywordTokenizerFactory"/>
191 <!-- The LowerCase TokenFilter does what you expect, which can be
192 when you want your sorting to be case insensitive
193 -->
194 <filter class="solr.LowerCaseFilterFactory" />
195 <!-- The TrimFilter removes any leading or trailing whitespace -->
196 <filter class="solr.TrimFilterFactory" />
197 <!-- The PatternReplaceFilter gives you the flexibility to use
198 Java Regular expression to replace any sequence of characters
199 matching a pattern with an arbitrary replacement string,
200 which may include back refrences to portions of the orriginal
201 string matched by the pattern.
202
203 See the Java Regular Expression documentation for more
204 infomation on pattern and replacement string syntax.
205
206 http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
207 -->
208 <filter class="solr.PatternReplaceFilterFactory"
209 pattern="([^a-z])" replacement="" replace="all"
210 />
211 </analyzer>
212 </fieldType>
213
214 <!-- since fields of this type are by default not stored or indexed, any data added to
215 them will be ignored outright
216 -->
217 <fieldtype name="ignored" stored="false" indexed="false" class="solr.StrField" />
218
219 </types>
220
221
222 <fields>
223 <field name="id" type="string" indexed="true" stored="true" required="true" />
224 <field name="title" type="text" indexed="true" stored="true"/>
225 <field name="text" type="text" indexed="true" stored="true"/>
226 <field name="date" type="date" indexed="true" stored="true"/>
227 <field name="dateline" type="text" indexed="true" stored="true"/>
228 <field name="places" type="string" indexed="true" stored="true" multiValued="true" omitNorms="true" termVectors="true" />
229 <field name="countryCodes" type="string" indexed="true" stored="true" multiValued="true" omitNorms="true" termVectors="true" />
230 <field name="topics" type="string" indexed="true" stored="true" multiValued="true" omitNorms="true" termVectors="true" />
231 <field name="organisations" type="string" indexed="true" stored="true" multiValued="true" omitNorms="true" termVectors="true" />
232 <field name="exchanges" type="string" indexed="true" stored="true" multiValued="true" omitNorms="true" termVectors="true" />
233 <field name="companies" type="string" indexed="true" stored="true" multiValued="true" omitNorms="true" termVectors="true" />
234 <field name="allText" type="text" indexed="true" stored="true" multiValued="true" omitNorms="true" termVectors="true" />
235 </fields>
236
237 <copyField source="title" dest="allText"/>
238 <copyField source="text" dest="allText"/>
239 <copyField source="places" dest="allText"/>
240 <copyField source="topics" dest="allText"/>
241 <copyField source="companies" dest="allText"/>
242 <copyField source="exchanges" dest="allText"/>
243
244 <uniqueKey>id</uniqueKey>
245
246 <defaultSearchField>text</defaultSearchField>
247
248 <solrQueryParser defaultOperator="OR"/>
249
250
251 </schema>
Something went wrong with that request. Please try again.