1 <?xml version="1.0" encoding="UTF-8" ?>
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
10 http://www.apache.org/licenses/LICENSE-2.0
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.
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.
25 This example schema is the recommended starting point for users.
26 It should be kept correct and concise, usable out-of-the-box.
28 For more information, on how to customize this file, please see
29 http://wiki.apache.org/solr/SchemaXml
31 PERFORMANCE NOTE: this schema includes many optional features and should not
32 be used for benchmarking. To improve performance one could
33 - set stored="false" for all fields possible (esp large fields) when you
34 only need to search on the field but don't need to return the original
36 - set indexed="false" if you don't need to search on the field, but only
37 return the field as a result of searching on other indexed fields.
38 - remove all unneeded copyField statements
39 - for best index size and searching performance, set "index" to false
40 for all general text fields, use copyField to copy them to the
41 catchall "text" field, and use that for searching.
42 - For maximum indexing performance, use the StreamingUpdateSolrServer
44 - Remember to run the JVM in server mode, and use a higher logging level
45 that avoids logging every request
48 <schema name="example" version="1.5">
49 <!-- attribute "name" is the name of this schema and is only used for display purposes.
50 version="x.y" is Solr's version number for the schema syntax and semantics. It should
51 not normally be changed by applications.
52 1.0: multiValued attribute did not exist, all fields are multiValued by nature
53 1.1: multiValued attribute introduced, false by default
54 1.2: omitTermFreqAndPositions attribute introduced, true by default except for text fields.
55 1.3: removed optional field compress feature
56 1.4: default auto-phrase (QueryParser feature) to off
57 1.5: omitNorms defaults to true for primitive field types (int, float, boolean, string...)
61 <!-- Valid attributes for fields:
62 name: mandatory - the name for the field
63 type: mandatory - the name of a field type from the
64 <types> fieldType section
65 indexed: true if this field should be indexed (searchable or sortable)
66 stored: true if this field should be retrievable
67 multiValued: true if this field may contain multiple values per document
68 omitNorms: (expert) set to true to omit the norms associated with
69 this field (this disables length normalization and index-time
70 boosting for the field, and saves some memory). Only full-text
71 fields or fields that need an index-time boost need norms.
72 Norms are omitted for primitive (non-analyzed) types by default.
73 termVectors: [false] set to true to store the term vector for a
75 When using MoreLikeThis, fields used for similarity should be
76 stored for best performance.
77 termPositions: Store position information with the term vector.
78 This will increase storage costs.
79 termOffsets: Store offset information with the term vector. This
80 will increase storage costs.
81 required: The field is required. It will throw an error if the
83 default: a value that should be used if no value is specified
84 when adding a document.
87 <!-- field names should consist of alphanumeric or underscore characters only and
88 not start with a digit. This is not currently strictly enforced,
89 but other field names will not have first class support from all components
90 and back compatibility is not guaranteed. Names with both leading and
91 trailing underscores (e.g. _version_) are reserved.
94 <!-- <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" /> -->
95 <!-- <field name="sku" type="text_en_splitting_tight" indexed="true" stored="true" omitNorms="true"/> -->
96 <!-- <field name="name" type="text_general" indexed="true" stored="true"/> -->
97 <!-- <field name="manu" type="text_general" indexed="true" stored="true" omitNorms="true"/> -->
98 <!-- <field name="cat" type="string" indexed="true" stored="true" multiValued="true"/> -->
99 <!-- <field name="features" type="text_general" indexed="true" stored="true" multiValued="true"/> -->
100 <!-- <field name="includes" type="text_general" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true" /> -->
102 <!-- <field name="weight" type="float" indexed="true" stored="true"/> -->
103 <!-- <field name="price" type="float" indexed="true" stored="true"/> -->
104 <!-- <field name="popularity" type="int" indexed="true" stored="true" /> -->
105 <!-- <field name="inStock" type="boolean" indexed="true" stored="true" /> -->
107 <!-- <field name="store" type="location" indexed="true" stored="true"/> -->
109 <!-- Common metadata fields, named specifically to match up with
110 SolrCell metadata when parsing rich documents such as Word, PDF.
111 Some fields are multiValued only because Tika currently may return
112 multiple values for them. Some metadata is parsed from the documents,
113 but there are some which come from the client context:
114 "content_type": From the HTTP headers of incoming stream
115 "resourcename": From SolrCell request param resource.name
117 <!-- <field name="title" type="text_general" indexed="true" stored="true" multiValued="true"/> -->
118 <!-- <field name="subject" type="text_general" indexed="true" stored="true"/> -->
119 <!-- <field name="description" type="text_general" indexed="true" stored="true"/> -->
120 <!-- <field name="comments" type="text_general" indexed="true" stored="true"/> -->
121 <!-- <field name="author" type="text_general" indexed="true" stored="true"/> -->
122 <!-- <field name="keywords" type="text_general" indexed="true" stored="true"/> -->
123 <!-- <field name="category" type="text_general" indexed="true" stored="true"/> -->
124 <!-- <field name="resourcename" type="text_general" indexed="true" stored="true"/> -->
125 <!-- <field name="url" type="text_general" indexed="true" stored="true"/> -->
126 <!-- <field name="content_type" type="string" indexed="true" stored="true" multiValued="true"/> -->
127 <!-- <field name="last_modified" type="date" indexed="true" stored="true"/> -->
128 <!-- <field name="links" type="string" indexed="true" stored="true" multiValued="true"/> -->
130 <field name="book_id" type="int" indexed="true" stored="true" />
131 <field name="parent_id" type="int" indexed="false" stored="true" />
132 <field name="slug" type="lowercase" stored="false" indexed="true" omitNorms="true"/> <!-- no norms -->
133 <field name="is_book" type="boolean" stored="false" indexed="true"/>
134 <field name="authors" type="text_pl_nonstop" stored="false" indexed="true" multiValued="true" termPositions="true" termVectors="true"/>
135 <field name="translators" type="text_pl_nonstop" stored="false" indexed="true" multiValued="true" termPositions="true" termVectors="true" />
136 <field name="title" type="text_pl_nonstop" stored="false" indexed="true"/>
137 <!-- <field name="published_date" type="tdate" stored="false" indexed="true"/>-->
138 <field name="published_date" type="string" stored="true" indexed="true"/>
140 <field name="epochs" type="lowercase" stored="false" indexed="false" multiValued="true" />
141 <field name="kinds" type="lowercase" stored="false" indexed="false" multiValued="true" />
142 <field name="genres" type="lowercase" stored="false" indexed="false" multiValued="true" />
144 <field name="metadata" type="text_pl_nonstop" stored="false" indexed="true" multiValued="true" termPositions="true" termVectors="true" />
146 <field name="themes" type="lowercase" stored="true" indexed="true" termVectors="true" termPositions="true" multiValued="true" />
147 <field name="themes_pl" type="text_pl_nonstop" stored="true" indexed="true" termVectors="true" termPositions="true" multiValued="true" />
148 <field name="header_index" type="int" stored="true" indexed="true"/>
149 <field name="header_span" type="int" stored="true" indexed="true"/>
150 <field name="header_type" type="lowercase" stored="true" indexed="false"/>
151 <field name="text" type="text_pl" stored="false" indexed="true" termVectors="true" termPositions="true" />
153 <field name="snippets_position" type="int" stored="true" indexed="false"/>
154 <field name="snippets_length" type="int" stored="true" indexed="false"/>
155 <field name="snippets_revision" type="int" stored="true" indexed="false"/>
156 <field name="fragment_anchor" type="string" stored="true" indexed="false"/>
158 <field name="picture_id" type="int" indexed="true" stored="true" />
159 <field name="area_id" type="int" stored="true" indexed="false"/>
161 <field name="tag_id" type="int" stored="true" indexed="true"/>
162 <field name="tag_name" type="lowercase" stored="true" indexed="true" />
163 <field name="tag_name_pl" type="text_pl_nonstop" stored="false" indexed="true" multiValued="true"/>
164 <field name="tag_category" type="string" stored="true" indexed="true" />
165 <field name="is_pdcounter" type="boolean" stored="true" indexed="true" />
167 <!-- Main body of document extracted by SolrCell.
168 NOTE: This field is not indexed by default, since it is also copied to "text"
169 using copyField below. This is to save space. Use this field for returning and
170 highlighting document content. Use the "text" field to search the content. -->
171 <!-- <field name="content" type="text_general" indexed="false" stored="true" multiValued="true"/> -->
174 <!-- catchall field, containing all other searchable text fields (implemented
175 via copyField further on in this schema -->
176 <!-- <field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/> -->
178 <!-- catchall text field that indexes tokens both normally and in reverse for efficient
179 leading wildcard queries. -->
180 <!-- <field name="text_rev" type="text_general_rev" indexed="true" stored="false" multiValued="true"/> -->
182 <!-- non-tokenized version of manufacturer to make it easier to sort or group
183 results by manufacturer. copied from "manu" via copyField -->
184 <!-- <field name="manu_exact" type="string" indexed="true" stored="false"/> -->
186 <!-- <field name="payloads" type="payloads" indexed="true" stored="true"/> -->
188 <field name="_version_" type="long" indexed="true" stored="true"/>
190 <!-- Uncommenting the following will create a "timestamp" field using
191 a default value of "NOW" to indicate when each document was indexed.
194 <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
197 <!-- uncomment the following to ignore any fields that don't already match an existing
198 field name or dynamic field, rather than reporting them as an error.
199 alternately, change the type="ignored" to some other type e.g. "text" if you want
200 unknown fields indexed and/or stored by default -->
201 <!--dynamicField name="*" type="ignored" multiValued="true" /-->
202 <field name="uid" type="string" indexed="true" stored="true"/>
206 <!-- Field to use to determine and enforce document uniqueness.
207 Unless this field is marked with required="false", it will be a required field
209 <uniqueKey>uid</uniqueKey>
211 <!-- DEPRECATED: The defaultSearchField is consulted by various query parsers when
212 parsing a query string that isn't explicit about the field. Machine (non-user)
213 generated queries are best made explicit, or they can use the "df" request parameter
214 which takes precedence over this.
215 Note: Un-commenting defaultSearchField will be insufficient if your request handler
216 in solrconfig.xml defines "df", which takes precedence. That would need to be removed.
217 <defaultSearchField>text</defaultSearchField> -->
219 <!-- DEPRECATED: The defaultOperator (AND|OR) is consulted by various query parsers
220 when parsing a query string to determine if a clause of the query should be marked as
221 required or optional, assuming the clause isn't already marked by some operator.
222 The default is OR, which is generally assumed so it is not a good idea to change it
223 globally here. The "q.op" request parameter takes precedence over this.
224 <solrQueryParser defaultOperator="OR"/> -->
226 <!-- copyField commands copy one field to another at the time a document
227 is added to the index. It's used either to index the same field differently,
228 or to add multiple fields to the same field for easier/faster searching. -->
230 <copyField source="themes" dest="themes_pl"/>
231 <copyField source="tag_name" dest="tag_name_pl"/>
233 <copyField source="translators" dest="metadata"/>
234 <copyField source="epochs" dest="metadata"/>
235 <copyField source="kinds" dest="metadata"/>
236 <copyField source="genres" dest="metadata"/>
239 <copyField source="cat" dest="text"/>
240 <copyField source="name" dest="text"/>
241 <copyField source="manu" dest="text"/>
242 <copyField source="features" dest="text"/>
243 <copyField source="includes" dest="text"/>
244 <copyField source="manu" dest="manu_exact"/>
246 <!-- Copy the price into a currency enabled field (default USD) -->
247 <!-- <copyField source="price" dest="price_c"/>-->
249 <!-- Text fields from SolrCell to search by default in our catch-all field -->
250 <!-- <copyField source="title" dest="text"/>
251 <copyField source="author" dest="text"/>
252 <copyField source="description" dest="text"/>
253 <copyField source="keywords" dest="text"/>
254 <copyField source="content" dest="text"/>
255 <copyField source="content_type" dest="text"/>
256 <copyField source="resourcename" dest="text"/>
257 <copyField source="url" dest="text"/>-->
259 <!-- Create a string version of author for faceting -->
260 <!-- <copyField source="author" dest="author_s"/>-->
262 <!-- Above, multiple source fields are copied to the [text] field.
263 Another way to map multiple source fields to the same
264 destination field is to use the dynamic field syntax.
265 copyField also supports a maxChars to copy setting. -->
267 <!-- <copyField source="*_t" dest="text" maxChars="3000"/> -->
269 <!-- copy name to alphaNameSort, a field designed for sorting by name -->
270 <!-- <copyField source="name" dest="alphaNameSort"/> -->
273 <!-- field type definitions. The "name" attribute is
274 just a label to be used by field definitions. The "class"
275 attribute and any other attributes determine the real
276 behavior of the fieldType.
277 Class names starting with "solr" refer to java classes in a
278 standard package such as org.apache.solr.analysis
281 <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
282 <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
284 <!-- boolean type: "true" or "false" -->
285 <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
287 <!-- sortMissingLast and sortMissingFirst attributes are optional attributes are
288 currently supported on types that are sorted internally as strings
289 and on numeric types.
290 This includes "string","boolean", and, as of 3.5 (and 4.x),
291 int, float, long, date, double, including the "Trie" variants.
292 - If sortMissingLast="true", then a sort on this field will cause documents
293 without the field to come after documents with the field,
294 regardless of the requested sort order (asc or desc).
295 - If sortMissingFirst="true", then a sort on this field will cause documents
296 without the field to come before documents with the field,
297 regardless of the requested sort order.
298 - If sortMissingLast="false" and sortMissingFirst="false" (the default),
299 then default lucene sorting will be used which places docs without the
300 field first in an ascending sort and last in a descending sort.
304 Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
306 <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
307 <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
308 <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
309 <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
312 Numeric field types that index each value at various levels of precision
313 to accelerate range queries when the number of values between the range
314 endpoints is large. See the javadoc for NumericRangeQuery for internal
315 implementation details.
317 Smaller precisionStep values (specified in bits) will lead to more tokens
318 indexed per value, slightly larger index size, and faster range queries.
319 A precisionStep of 0 disables indexing at different precision levels.
321 <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
322 <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>
323 <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>
324 <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>
326 <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
327 is a more restricted form of the canonical representation of dateTime
328 http://www.w3.org/TR/xmlschema-2/#dateTime
329 The trailing "Z" designates UTC time and is mandatory.
330 Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
331 All other components are mandatory.
333 Expressions can also be used to denote calculations that should be
334 performed relative to "NOW" to determine the value, ie...
337 ... Round to the start of the current hour
339 ... Exactly 1 day prior to now
340 NOW/DAY+6MONTHS+3DAYS
341 ... 6 months and 3 days in the future from the start of
344 Consult the DateField javadocs for more information.
346 Note: For faster range queries, consider the tdate type
348 <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
350 <!-- A Trie based date field for faster date range queries and date faceting. -->
351 <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>
354 <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
355 <fieldtype name="binary" class="solr.BinaryField"/>
357 <!-- The "RandomSortField" is not used to store or search any
358 data. You can declare fields of this type it in your schema
359 to generate pseudo-random orderings of your docs for sorting
360 or function purposes. The ordering is generated based on the field
361 name and the version of the index. As long as the index version
362 remains unchanged, and the same field name is reused,
363 the ordering of the docs will be consistent.
364 If you want different psuedo-random orderings of documents,
365 for the same version of the index, use a dynamicField and
366 change the field name in the request.
368 <fieldType name="random" class="solr.RandomSortField" indexed="true" />
370 <!-- solr.TextField allows the specification of custom text analyzers
371 specified as a tokenizer and a list of token filters. Different
372 analyzers may be specified for indexing and querying.
374 The optional positionIncrementGap puts space between multiple fields of
375 this type on the same document, with the purpose of preventing false phrase
376 matching across fields.
378 For more info on customizing your analyzer chain, please see
379 http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
382 <!-- One can also specify an existing Analyzer class that has a
383 default constructor via the class attribute on the analyzer element.
385 <fieldType name="text_greek" class="solr.TextField">
386 <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
390 <fieldType name="uuid" class="solr.UUIDField" indexed="true" />
393 <!-- A text field that only splits on whitespace for exact matching of words -->
394 <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
396 <tokenizer class="solr.WhitespaceTokenizerFactory"/>
400 <!-- charFilter + WhitespaceTokenizer -->
402 <fieldType name="text_char_norm" class="solr.TextField" positionIncrementGap="100" >
404 <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
405 <tokenizer class="solr.WhitespaceTokenizerFactory"/>
410 <!-- lowercases the entire field value, keeping it as a single token. -->
411 <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
413 <tokenizer class="solr.KeywordTokenizerFactory"/>
414 <filter class="solr.LowerCaseFilterFactory" />
418 <!-- since fields of this type are by default not stored or indexed,
419 any data added to them will be ignored outright. -->
420 <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
423 <fieldType name="text_pl" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
425 <tokenizer class="solr.StandardTokenizerFactory"/>
426 <filter class="solr.LowerCaseFilterFactory"/>
427 <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pl.txt" format="snowball"/>
428 <filter class="solr.MorfologikFilterFactory" dictionary="morfologik/stemming/polish/polish.dict" />
432 <fieldType name="text_pl_nonstop" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
434 <tokenizer class="solr.StandardTokenizerFactory"/>
435 <filter class="solr.LowerCaseFilterFactory"/>
436 <filter class="solr.MorfologikFilterFactory" dictionary="morfologik/stemming/polish/polish.dict" />
442 <!-- Similarity is the scoring routine for each document vs. a query.
443 A custom Similarity or SimilarityFactory may be specified here, but
444 the default is fine for most applications.
445 For more info: http://wiki.apache.org/solr/SchemaXml#Similarity
448 <similarity class="com.example.solr.CustomSimilarityFactory">
449 <str name="paramkey">param value</str>