Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
218 lines (190 sloc) 11.1 KB
<?xml version="1.0" encoding="UTF-8" ?>
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
<schema name="rletters-3.0" version="1.6">
<!-- attribute "name" is the name of this schema and is only used for display purposes.
version="x.y" is Solr's version number for the schema syntax and
semantics. It should not normally be changed by applications.
1.0: multiValued attribute did not exist, all fields are multiValued
by nature
1.1: multiValued attribute introduced, false by default
1.2: omitTermFreqAndPositions attribute introduced, true by default
except for text fields.
1.3: removed optional field compress feature
1.4: autoGeneratePhraseQueries attribute introduced to drive QueryParser
behavior when a single string produces multiple tokens. Defaults
to off for version >= 1.4
1.5: omitNorms defaults to true for primitive field types
(int, float, boolean, string...)
1.6: useDocValuesAsStored defaults to true.
<!-- Valid attributes for fields:
name: mandatory - the name for the field
type: mandatory - the name of a field type from the
fieldTypes section
indexed: true if this field should be indexed (searchable or sortable)
stored: true if this field should be retrievable
docValues: true if this field should have doc values. Doc Values is
recommended (required, if you are using *Point fields) for faceting,
grouping, sorting and function queries. Doc Values will make the index
faster to load, more NRT-friendly and more memory-efficient.
They are currently only supported by StrField, UUIDField, all
*PointFields, and depending on the field type, they might require
the field to be single-valued, be required or have a default value
(check the documentation of the field type you're interested in for
more information)
multiValued: true if this field may contain multiple values per document
omitNorms: (expert) set to true to omit the norms associated with
this field (this disables length normalization and index-time
boosting for the field, and saves some memory). Only full-text
fields or fields that need an index-time boost need norms.
Norms are omitted for primitive (non-analyzed) types by default.
termVectors: [false] set to true to store the term vector for a
given field.
When using MoreLikeThis, fields used for similarity should be
stored for best performance.
termPositions: Store position information with the term vector.
This will increase storage costs.
termOffsets: Store offset information with the term vector. This
will increase storage costs.
required: The field is required. It will throw an error if the
value does not exist
default: a value that should be used if no value is specified
when adding a document.
<!-- field names should consist of alphanumeric or underscore characters only and
not start with a digit. This is not currently strictly enforced,
but other field names will not have first class support from all components
and back compatibility is not guaranteed. Names with both leading and
trailing underscores (e.g. _version_) are reserved.
<field name="_version_" type="plong" indexed="false" stored="false" />
<!-- UID and DOI are stored verbatim -->
<field name="uid" type="string" indexed="true" stored="true" required="true" omitNorms="true" multiValued="false" />
<field name="doi" type="string" indexed="true" stored="true" omitNorms="true" />
<!-- The license type and URL are stored verbatim -->
<field name="license" type="string" indexed="true" stored="true" omitNorms="true" />
<field name="license_url" type="string" indexed="true" stored="true" omitNorms="true" />
<!-- The original source for this piece of data (searchable) -->
<field name="data_source" type="text_splitLower" indexed="true" stored="true" omitNorms="true" />
<!-- The original bibliographic data: search it, but don't delete stopwords -->
<field name="authors" type="text_splitLower" indexed="true" stored="true" omitNorms="true" />
<field name="title" type="text_splitLower" indexed="true" stored="true" omitNorms="true" />
<field name="journal" type="text_splitLower" indexed="true" stored="true" omitNorms="true" />
<field name="year" type="text_splitLower" indexed="true" stored="true" omitNorms="true" />
<field name="volume" type="text_splitLower" indexed="true" stored="true" omitNorms="true" />
<field name="number" type="text_splitLower" indexed="true" stored="true" omitNorms="true" />
<field name="pages" type="text_pageNumber" indexed="true" stored="true" omitNorms="true" />
<!-- The full text, split, lowered, and only stored as term vectors -->
<field name="fulltext" type="text_splitLower" indexed="true" stored="false" omitNorms="false" termVectors="true" termPositions="true" termOffsets="true" />
<!-- These three fields can be searched with stemming enabled -->
<field name="title_stem" type="text_splitLowerStopStem" indexed="true" stored="false" omitNorms="true" />
<field name="journal_stem" type="text_splitLowerStopStem" indexed="true" stored="false" omitNorms="true" />
<field name="fulltext_stem" type="text_splitLowerStopStem" indexed="true" stored="false" omitNorms="false" multiValued="true" />
<!-- Faceting stores data in different formats (authors are tokenized by author,
journals aren't tokenized whatsoever) -->
<field name="authors_facet" type="text_commaDelimited" indexed="true" stored="false" omitNorms="true" />
<field name="journal_facet" type="text_noTokens" indexed="true" stored="false" omitNorms="true" />
<!-- Sorting requires fields that aren't tokenized at all -->
<field name="authors_sort" type="text_noTokens" indexed="true" stored="false" omitNorms="true" />
<field name="title_sort" type="text_noTokens" indexed="true" stored="false" omitNorms="true" />
<field name="journal_sort" type="text_noTokens" indexed="true" stored="false" omitNorms="true" />
<field name="year_sort" type="text_noTokens" indexed="true" stored="false" omitNorms="true" />
<!-- Field to use to determine and enforce document uniqueness.
Unless this field is marked with required="false", it will be a required field
<!-- copyField commands copy one field to another at the time a document
is added to the index. It's used either to index the same field differently,
or to add multiple fields to the same field for easier/faster searching. -->
<!-- Copy our _stem fields -->
<copyField source="title" dest="title_stem"/>
<copyField source="journal" dest="journal_stem"/>
<copyField source="fulltext" dest="fulltext_stem"/>
<!-- Copy our facet fields -->
<copyField source="authors" dest="authors_facet"/>
<copyField source="journal" dest="journal_facet"/>
<!-- Copy our sort fields -->
<copyField source="authors" dest="authors_sort"/>
<copyField source="title" dest="title_sort"/>
<copyField source="journal" dest="journal_sort"/>
<copyField source="year" dest="year_sort"/>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true" />
<fieldType name="plong" class="solr.LongPointField" docValues="true" />
<!-- All of the below text types have a LengthFilter applied, so that
exceptionally long terms will not generate Solr/Lucene exceptions
(see LUCENE-5472, Solr >= 4.8.0). This is a safety measure against
crazy OCR data. -->
<!-- Don't even tokenize (for certain kinds of faceting) -->
<fieldType name="text_noTokens" class="solr.TextField" positionIncrementGap="20">
<!-- This tokenizer is completely misnamed: it does nothing to the input string -->
<tokenizer class="solr.KeywordTokenizerFactory" />
<filter class="solr.LengthFilterFactory" min="1" max="32766" />
<!-- Split on commas, for faceting on the "Author" field -->
<fieldType name="text_commaDelimited" class="solr.TextField" positionIncrementGap="20">
<tokenizer class="solr.PatternTokenizerFactory" pattern="\s*,\s*" />
<filter class="solr.LengthFilterFactory" min="1" max="32766" />
<!-- A field that splits on dashes and preserves original tokens; this is
used only for page numbers (issue #4) -->
<fieldType name="text_pageNumber" class="solr.TextField" positionIncrementGap="20">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LengthFilterFactory" min="1" max="32766" />
<filter class="solr.WordDelimiterGraphFilterFactory"
splitOnCaseChange="0" splitOnNumerics="0"
stemEnglishPossessive="0" preserveOriginal="1"/>
<filter class="solr.FlattenGraphFilterFactory"/>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LengthFilterFactory" min="1" max="32766" />
<filter class="solr.WordDelimiterGraphFilterFactory"
splitOnCaseChange="0" splitOnNumerics="0"
stemEnglishPossessive="0" preserveOriginal="1"/>
<!-- A text field that:
- splits tokens by whitespace or punctuation (issue #2)
- lowercases -->
<fieldType name="text_splitLower" class="solr.TextField" positionIncrementGap="100">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LengthFilterFactory" min="1" max="32766" />
<filter class="solr.LowerCaseFilterFactory"/>
<!-- All the processing of the previous filter, plus:
- Removal of stop words
- Removal of 's from the end of English possessives
- English-language stemming
<fieldType name="text_splitLowerStopStem" class="solr.TextField" positionIncrementGap="100">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LengthFilterFactory" min="1" max="32766" />
<filter class="solr.StopFilterFactory"
ignoreCase="true" words="stopwords.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>