Fundraising in PDF.
[wolnelektury.git] / doc / schema.xml
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  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
35     value.
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
43     java client.
44   - Remember to run the JVM in server mode, and use a higher logging level
45     that avoids logging every request
46 -->
47
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...)
58      -->
59
60  <fields>
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
74        given field.
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
82        value does not exist
83      default: a value that should be used if no value is specified
84        when adding a document.
85    -->
86
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.
92    -->
93
94    <field name="book_id" type="int" indexed="true" stored="true" />
95    <field name="parent_id" type="int" indexed="false" stored="true" />
96    <field name="slug" type="lowercase" stored="false" indexed="true" omitNorms="true"/> <!-- no norms -->
97    <field name="is_book" type="boolean" stored="false" indexed="true"/>
98    <field name="authors" type="text_pl_nonstop" stored="false" indexed="true" multiValued="true" termPositions="true" termVectors="true"/>
99    <field name="authors_nonstem" type="text_ascii" stored="false" indexed="true" multiValued="true" termPositions="true" termVectors="true"/>
100    <field name="translators" type="text_pl_nonstop" stored="false" indexed="true" multiValued="true" termPositions="true" termVectors="true" />
101    <field name="title" type="text_pl_nonstop" stored="false" indexed="true"/>
102    <field name="title_nonstem" type="text_ascii" stored="false" indexed="true"/>
103 <!--   <field name="published_date" type="tdate" stored="false" indexed="true"/>-->
104    <field name="published_date" type="string" stored="true" indexed="true"/>
105
106    <field name="epochs" type="lowercase" stored="false" indexed="false" multiValued="true" />
107    <field name="kinds" type="lowercase" stored="false" indexed="false" multiValued="true" />
108    <field name="genres" type="lowercase" stored="false" indexed="false" multiValued="true" />
109
110    <field name="metadata" type="text_pl_nonstop" stored="false" indexed="true" multiValued="true" termPositions="true" termVectors="true" />
111    <field name="metadata_nonstem" type="text_pl_nonstop" stored="false" indexed="true" multiValued="true" termPositions="true" termVectors="true" />
112
113    <field name="themes" type="lowercase" stored="true" indexed="true" termVectors="true" termPositions="true" multiValued="true" />
114    <field name="themes_pl" type="text_pl_nonstop" stored="true" indexed="true" termVectors="true" termPositions="true" multiValued="true" />
115    <field name="themes_pl_nonstem" type="text_ascii" stored="true" indexed="true" termVectors="true" termPositions="true" multiValued="true" />
116    <field name="header_index" type="int" stored="true" indexed="true"/>
117    <field name="header_span" type="int" stored="true" indexed="true"/>
118    <field name="header_type" type="lowercase" stored="true" indexed="false"/>
119    <field name="text" type="text_pl" stored="false" indexed="true" termVectors="true" termPositions="true" />
120    <field name="text_nonstem" type="text_pl_nonstem" stored="false" indexed="true" termVectors="true" termPositions="true" />
121
122    <field name="snippets_position" type="int" stored="true" indexed="false"/>
123    <field name="snippets_length" type="int" stored="true" indexed="false"/>
124    <field name="snippets_revision" type="int" stored="true" indexed="false"/>
125    <field name="fragment_anchor" type="string" stored="true" indexed="false"/>
126
127    <field name="picture_id" type="int" indexed="true" stored="true" />
128    <field name="area_id" type="int" stored="true" indexed="false"/>
129
130    <field name="tag_id" type="int" stored="true" indexed="true"/>
131    <field name="tag_name" type="lowercase" stored="true" indexed="true" />
132    <field name="tag_name_pl" type="text_pl_nonstop" stored="false" indexed="true" multiValued="true"/>
133    <field name="tag_category" type="string" stored="true" indexed="true" />
134    <field name="is_pdcounter" type="boolean" stored="true" indexed="true" />
135
136    <field name="_version_" type="long" indexed="true" stored="true"/>
137
138    <!-- Uncommenting the following will create a "timestamp" field using
139         a default value of "NOW" to indicate when each document was indexed.
140      -->
141    <!--
142    <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
143      -->
144
145    <!-- uncomment the following to ignore any fields that don't already match an existing 
146         field name or dynamic field, rather than reporting them as an error. 
147         alternately, change the type="ignored" to some other type e.g. "text" if you want 
148         unknown fields indexed and/or stored by default --> 
149    <!--dynamicField name="*" type="ignored" multiValued="true" /-->
150     <field name="uid" type="string" indexed="true" stored="true"/>
151  </fields>
152
153
154  <!-- Field to use to determine and enforce document uniqueness. 
155       Unless this field is marked with required="false", it will be a required field
156    -->
157  <uniqueKey>uid</uniqueKey>
158
159   <!-- copyField commands copy one field to another at the time a document
160         is added to the index.  It's used either to index the same field differently,
161         or to add multiple fields to the same field for easier/faster searching.  -->
162
163   <copyField source="themes" dest="themes_pl"/>
164   <copyField source="tag_name" dest="tag_name_pl"/>
165
166   <copyField source="translators" dest="metadata"/>
167   <copyField source="epochs" dest="metadata"/>
168   <copyField source="kinds" dest="metadata"/>
169   <copyField source="genres" dest="metadata"/>
170
171   <copyField source="translators" dest="metadata_nonstem"/>
172   <copyField source="epochs" dest="metadata_nonstem"/>
173   <copyField source="kinds" dest="metadata_nonstem"/>
174   <copyField source="genres" dest="metadata_nonstem"/>
175
176   <copyField source="authors" dest="authors_nonstem"/>
177   <copyField source="title" dest="title_nonstem"/>
178   <copyField source="themes" dest="themes_pl_nonstem"/>
179   <copyField source="text" dest="text_nonstem"/>
180
181   <types>
182     <!-- field type definitions. The "name" attribute is
183        just a label to be used by field definitions.  The "class"
184        attribute and any other attributes determine the real
185        behavior of the fieldType.
186          Class names starting with "solr" refer to java classes in a
187        standard package such as org.apache.solr.analysis
188     -->
189
190     <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
191     <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
192
193     <!-- boolean type: "true" or "false" -->
194     <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
195
196     <!-- sortMissingLast and sortMissingFirst attributes are optional attributes are
197          currently supported on types that are sorted internally as strings
198          and on numeric types.
199          This includes "string","boolean", and, as of 3.5 (and 4.x),
200          int, float, long, date, double, including the "Trie" variants.
201        - If sortMissingLast="true", then a sort on this field will cause documents
202          without the field to come after documents with the field,
203          regardless of the requested sort order (asc or desc).
204        - If sortMissingFirst="true", then a sort on this field will cause documents
205          without the field to come before documents with the field,
206          regardless of the requested sort order.
207        - If sortMissingLast="false" and sortMissingFirst="false" (the default),
208          then default lucene sorting will be used which places docs without the
209          field first in an ascending sort and last in a descending sort.
210     -->    
211
212     <!--
213       Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
214     -->
215     <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
216     <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
217     <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
218     <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
219
220     <!--
221      Numeric field types that index each value at various levels of precision
222      to accelerate range queries when the number of values between the range
223      endpoints is large. See the javadoc for NumericRangeQuery for internal
224      implementation details.
225
226      Smaller precisionStep values (specified in bits) will lead to more tokens
227      indexed per value, slightly larger index size, and faster range queries.
228      A precisionStep of 0 disables indexing at different precision levels.
229     -->
230     <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
231     <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>
232     <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>
233     <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>
234
235     <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
236          is a more restricted form of the canonical representation of dateTime
237          http://www.w3.org/TR/xmlschema-2/#dateTime
238          The trailing "Z" designates UTC time and is mandatory.
239          Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
240          All other components are mandatory.
241
242          Expressions can also be used to denote calculations that should be
243          performed relative to "NOW" to determine the value, ie...
244
245                NOW/HOUR
246                   ... Round to the start of the current hour
247                NOW-1DAY
248                   ... Exactly 1 day prior to now
249                NOW/DAY+6MONTHS+3DAYS
250                   ... 6 months and 3 days in the future from the start of
251                       the current day
252                       
253          Consult the DateField javadocs for more information.
254
255          Note: For faster range queries, consider the tdate type
256       -->
257     <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
258
259     <!-- A Trie based date field for faster date range queries and date faceting. -->
260     <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>
261
262
263     <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
264     <fieldtype name="binary" class="solr.BinaryField"/>
265
266     <!-- The "RandomSortField" is not used to store or search any
267          data.  You can declare fields of this type it in your schema
268          to generate pseudo-random orderings of your docs for sorting 
269          or function purposes.  The ordering is generated based on the field
270          name and the version of the index. As long as the index version
271          remains unchanged, and the same field name is reused,
272          the ordering of the docs will be consistent.  
273          If you want different psuedo-random orderings of documents,
274          for the same version of the index, use a dynamicField and
275          change the field name in the request.
276      -->
277     <fieldType name="random" class="solr.RandomSortField" indexed="true" />
278
279     <fieldType name="uuid" class="solr.UUIDField" indexed="true" />
280
281
282     <!-- A text field that only splits on whitespace for exact matching of words -->
283     <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
284       <analyzer>
285         <tokenizer class="solr.WhitespaceTokenizerFactory"/>
286       </analyzer>
287     </fieldType>
288
289     <!-- charFilter + WhitespaceTokenizer  -->
290     <!--
291     <fieldType name="text_char_norm" class="solr.TextField" positionIncrementGap="100" >
292       <analyzer>
293         <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
294         <tokenizer class="solr.WhitespaceTokenizerFactory"/>
295       </analyzer>
296     </fieldType>
297     -->
298
299     <!-- lowercases the entire field value, keeping it as a single token.  -->
300     <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
301       <analyzer>
302         <tokenizer class="solr.KeywordTokenizerFactory"/>
303         <filter class="solr.LowerCaseFilterFactory" />
304       </analyzer>
305     </fieldType>
306
307     <!-- since fields of this type are by default not stored or indexed,
308          any data added to them will be ignored outright.  --> 
309     <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
310
311     <!-- Polish -->
312     <fieldType name="text_pl" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
313       <analyzer type="index">
314         <tokenizer class="solr.StandardTokenizerFactory"/>
315         <filter class="solr.LowerCaseFilterFactory"/>
316         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pl.txt" format="snowball"/>
317         <filter class="solr.MorfologikFilterFactory" dictionary="morfologik/stemming/polish/polish.dict" />
318         <filter class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true" />
319       </analyzer>
320       <analyzer type="query">
321         <tokenizer class="solr.StandardTokenizerFactory"/>
322         <filter class="solr.LowerCaseFilterFactory"/>
323         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pl.txt" format="snowball"/>
324         <filter class="solr.MorfologikFilterFactory" dictionary="morfologik/stemming/polish/polish.dict" />
325       </analyzer>
326     </fieldType>
327
328     <fieldType name="text_pl_nonstem" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
329       <analyzer type="index">
330         <tokenizer class="solr.StandardTokenizerFactory"/>
331         <filter class="solr.LowerCaseFilterFactory"/>
332         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pl.txt" format="snowball"/>
333         <filter class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true" />
334       </analyzer>
335       <analyzer type="query">
336         <tokenizer class="solr.StandardTokenizerFactory"/>
337         <filter class="solr.LowerCaseFilterFactory"/>
338         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pl.txt" format="snowball"/>
339       </analyzer>
340     </fieldType>
341
342     <fieldType name="text_pl_nonstop" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
343       <analyzer type="index">
344         <tokenizer class="solr.StandardTokenizerFactory"/>
345         <filter class="solr.LowerCaseFilterFactory"/>
346         <filter class="solr.MorfologikFilterFactory" dictionary="morfologik/stemming/polish/polish.dict" />
347         <filter class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true" />
348       </analyzer>
349       <analyzer type="query">
350         <tokenizer class="solr.StandardTokenizerFactory"/>
351         <filter class="solr.LowerCaseFilterFactory"/>
352         <filter class="solr.MorfologikFilterFactory" dictionary="morfologik/stemming/polish/polish.dict" />
353       </analyzer>
354     </fieldType>
355
356     <fieldType name="text_ascii" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
357       <analyzer type="index">
358         <tokenizer class="solr.StandardTokenizerFactory"/>
359         <filter class="solr.LowerCaseFilterFactory"/>
360         <filter class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true" />
361       </analyzer>
362       <analyzer type="query">
363         <tokenizer class="solr.StandardTokenizerFactory"/>
364         <filter class="solr.LowerCaseFilterFactory"/>
365       </analyzer>
366     </fieldType>
367 cb
368  </types>
369   
370   <!-- Similarity is the scoring routine for each document vs. a query.
371        A custom Similarity or SimilarityFactory may be specified here, but 
372        the default is fine for most applications.  
373        For more info: http://wiki.apache.org/solr/SchemaXml#Similarity
374     -->
375   <!--
376      <similarity class="com.example.solr.CustomSimilarityFactory">
377        <str name="paramkey">param value</str>
378      </similarity>
379     -->
380
381 </schema>