[7588] | 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 | |
---|
| 32 | <schema name="rss" version="1.1"> |
---|
| 33 | <!-- attribute "name" is the name of this schema and is only used for display purposes. |
---|
| 34 | Applications should change this to reflect the nature of the search collection. |
---|
| 35 | version="1.1" is Solr's version number for the schema syntax and semantics. It should |
---|
| 36 | not normally be changed by applications. |
---|
| 37 | 1.0: multiValued attribute did not exist, all fields are multiValued by nature |
---|
| 38 | 1.1: multiValued attribute introduced, false by default --> |
---|
| 39 | |
---|
| 40 | <types> |
---|
| 41 | <!-- field type definitions. The "name" attribute is |
---|
| 42 | just a label to be used by field definitions. The "class" |
---|
| 43 | attribute and any other attributes determine the real |
---|
| 44 | behavior of the fieldType. |
---|
| 45 | Class names starting with "solr" refer to java classes in the |
---|
| 46 | org.apache.solr.analysis package. |
---|
| 47 | --> |
---|
| 48 | |
---|
| 49 | <!-- The StrField type is not analyzed, but indexed/stored verbatim. |
---|
| 50 | - StrField and TextField support an optional compressThreshold which |
---|
| 51 | limits compression (if enabled in the derived fields) to values which |
---|
| 52 | exceed a certain size (in characters). |
---|
| 53 | --> |
---|
| 54 | <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/> |
---|
| 55 | |
---|
| 56 | <!-- boolean type: "true" or "false" --> |
---|
| 57 | <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/> |
---|
| 58 | |
---|
| 59 | <!-- The optional sortMissingLast and sortMissingFirst attributes are |
---|
| 60 | currently supported on types that are sorted internally as strings. |
---|
| 61 | - If sortMissingLast="true", then a sort on this field will cause documents |
---|
| 62 | without the field to come after documents with the field, |
---|
| 63 | regardless of the requested sort order (asc or desc). |
---|
| 64 | - If sortMissingFirst="true", then a sort on this field will cause documents |
---|
| 65 | without the field to come before documents with the field, |
---|
| 66 | regardless of the requested sort order. |
---|
| 67 | - If sortMissingLast="false" and sortMissingFirst="false" (the default), |
---|
| 68 | then default lucene sorting will be used which places docs without the |
---|
| 69 | field first in an ascending sort and last in a descending sort. |
---|
| 70 | --> |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | <!-- numeric field types that store and index the text |
---|
| 74 | value verbatim (and hence don't support range queries, since the |
---|
| 75 | lexicographic ordering isn't equal to the numeric ordering) --> |
---|
| 76 | <fieldType name="integer" class="solr.IntField" omitNorms="true"/> |
---|
| 77 | <fieldType name="long" class="solr.LongField" omitNorms="true"/> |
---|
| 78 | <fieldType name="float" class="solr.FloatField" omitNorms="true"/> |
---|
| 79 | <fieldType name="double" class="solr.DoubleField" omitNorms="true"/> |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | <!-- Numeric field types that manipulate the value into |
---|
| 83 | a string value that isn't human-readable in its internal form, |
---|
| 84 | but with a lexicographic ordering the same as the numeric ordering, |
---|
| 85 | so that range queries work correctly. --> |
---|
| 86 | <fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/> |
---|
| 87 | <fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/> |
---|
| 88 | <fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/> |
---|
| 89 | <fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/> |
---|
| 90 | |
---|
| 91 | |
---|
| 92 | <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and |
---|
| 93 | is a more restricted form of the canonical representation of dateTime |
---|
| 94 | http://www.w3.org/TR/xmlschema-2/#dateTime |
---|
| 95 | The trailing "Z" designates UTC time and is mandatory. |
---|
| 96 | Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z |
---|
| 97 | All other components are mandatory. |
---|
| 98 | |
---|
| 99 | Expressions can also be used to denote calculations that should be |
---|
| 100 | performed relative to "NOW" to determine the value, ie... |
---|
| 101 | |
---|
| 102 | NOW/HOUR |
---|
| 103 | ... Round to the start of the current hour |
---|
| 104 | NOW-1DAY |
---|
| 105 | ... Exactly 1 day prior to now |
---|
| 106 | NOW/DAY+6MONTHS+3DAYS |
---|
| 107 | ... 6 months and 3 days in the future from the start of |
---|
| 108 | the current day |
---|
| 109 | |
---|
| 110 | Consult the DateField javadocs for more information. |
---|
| 111 | --> |
---|
| 112 | <fieldType name="date" class="solr.DateField" sortMissingLast="true" omitNorms="true"/> |
---|
| 113 | |
---|
| 114 | |
---|
| 115 | <!-- The "RandomSortField" is not used to store or search any |
---|
| 116 | data. You can declare fields of this type it in your schema |
---|
| 117 | to generate psuedo-random orderings of your docs for sorting |
---|
| 118 | purposes. The ordering is generated based on the field name |
---|
| 119 | and the version of the index, As long as the index version |
---|
| 120 | remains unchanged, and the same field name is reused, |
---|
| 121 | the ordering of the docs will be consistent. |
---|
| 122 | If you want differend psuedo-random orderings of documents, |
---|
| 123 | for the same version of the index, use a dynamicField and |
---|
| 124 | change the name |
---|
| 125 | --> |
---|
| 126 | <fieldType name="random" class="solr.RandomSortField" indexed="true" /> |
---|
| 127 | |
---|
| 128 | <!-- solr.TextField allows the specification of custom text analyzers |
---|
| 129 | specified as a tokenizer and a list of token filters. Different |
---|
| 130 | analyzers may be specified for indexing and querying. |
---|
| 131 | |
---|
| 132 | The optional positionIncrementGap puts space between multiple fields of |
---|
| 133 | this type on the same document, with the purpose of preventing false phrase |
---|
| 134 | matching across fields. |
---|
| 135 | |
---|
| 136 | For more info on customizing your analyzer chain, please see |
---|
| 137 | http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters |
---|
| 138 | --> |
---|
| 139 | |
---|
| 140 | <!-- One can also specify an existing Analyzer class that has a |
---|
| 141 | default constructor via the class attribute on the analyzer element |
---|
| 142 | <fieldType name="text_greek" class="solr.TextField"> |
---|
| 143 | <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/> |
---|
| 144 | </fieldType> |
---|
| 145 | --> |
---|
| 146 | |
---|
| 147 | <!-- A text field that only splits on whitespace for exact matching of words --> |
---|
| 148 | <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100"> |
---|
| 149 | <analyzer> |
---|
| 150 | <tokenizer class="solr.WhitespaceTokenizerFactory"/> |
---|
| 151 | </analyzer> |
---|
| 152 | </fieldType> |
---|
| 153 | |
---|
| 154 | <!-- A text field that uses WordDelimiterFilter to enable splitting and matching of |
---|
| 155 | words on case-change, alpha numeric boundaries, and non-alphanumeric chars, |
---|
| 156 | so that a query of "wifi" or "wi fi" could match a document containing "Wi-Fi". |
---|
| 157 | Synonyms and stopwords are customized by external files, and stemming is enabled. |
---|
| 158 | Duplicate tokens at the same position (which may result from Stemmed Synonyms or |
---|
| 159 | WordDelim parts) are removed. |
---|
| 160 | --> |
---|
| 161 | <fieldType name="text" class="solr.TextField" positionIncrementGap="100"> |
---|
| 162 | <analyzer type="index"> |
---|
| 163 | <tokenizer class="solr.WhitespaceTokenizerFactory"/> |
---|
| 164 | <!-- in this example, we will only use synonyms at query time |
---|
| 165 | <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/> |
---|
| 166 | --> |
---|
| 167 | <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> |
---|
| 168 | <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/> |
---|
| 169 | <filter class="solr.LowerCaseFilterFactory"/> |
---|
| 170 | <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> |
---|
| 171 | <filter class="solr.PorterStemFilterFactory"/> |
---|
| 172 | <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> |
---|
| 173 | </analyzer> |
---|
| 174 | <analyzer type="query"> |
---|
| 175 | <tokenizer class="solr.WhitespaceTokenizerFactory"/> |
---|
| 176 | <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> |
---|
| 177 | <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> |
---|
| 178 | <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/> |
---|
| 179 | <filter class="solr.LowerCaseFilterFactory"/> |
---|
| 180 | <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> |
---|
| 181 | <filter class="solr.PorterStemFilterFactory"/> |
---|
| 182 | <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> |
---|
| 183 | </analyzer> |
---|
| 184 | </fieldType> |
---|
| 185 | |
---|
| 186 | |
---|
| 187 | <!-- Less flexible matching, but less false matches. Probably not ideal for product names, |
---|
| 188 | but may be good for SKUs. Can insert dashes in the wrong place and still match. --> |
---|
| 189 | <fieldType name="textTight" class="solr.TextField" positionIncrementGap="100" > |
---|
| 190 | <analyzer> |
---|
| 191 | <tokenizer class="solr.WhitespaceTokenizerFactory"/> |
---|
| 192 | <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/> |
---|
| 193 | <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> |
---|
| 194 | <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/> |
---|
| 195 | <filter class="solr.LowerCaseFilterFactory"/> |
---|
| 196 | <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> |
---|
| 197 | <filter class="solr.EnglishMinimalStemFilterFactory"/> |
---|
| 198 | <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> |
---|
| 199 | </analyzer> |
---|
| 200 | </fieldType> |
---|
| 201 | |
---|
| 202 | <!-- This is an example of using the KeywordTokenizer along |
---|
| 203 | With various TokenFilterFactories to produce a sortable field |
---|
| 204 | that does not include some properties of the source text |
---|
| 205 | --> |
---|
| 206 | <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true"> |
---|
| 207 | <analyzer> |
---|
| 208 | <!-- KeywordTokenizer does no actual tokenizing, so the entire |
---|
| 209 | input string is preserved as a single token |
---|
| 210 | --> |
---|
| 211 | <tokenizer class="solr.KeywordTokenizerFactory"/> |
---|
| 212 | <!-- The LowerCase TokenFilter does what you expect, which can be |
---|
| 213 | when you want your sorting to be case insensitive |
---|
| 214 | --> |
---|
| 215 | <filter class="solr.LowerCaseFilterFactory" /> |
---|
| 216 | <!-- The TrimFilter removes any leading or trailing whitespace --> |
---|
| 217 | <filter class="solr.TrimFilterFactory" /> |
---|
| 218 | <!-- The PatternReplaceFilter gives you the flexibility to use |
---|
| 219 | Java Regular expression to replace any sequence of characters |
---|
| 220 | matching a pattern with an arbitrary replacement string, |
---|
| 221 | which may include back refrences to portions of the orriginal |
---|
| 222 | string matched by the pattern. |
---|
| 223 | |
---|
| 224 | See the Java Regular Expression documentation for more |
---|
| 225 | infomation on pattern and replacement string syntax. |
---|
| 226 | |
---|
| 227 | http://java.sun.com/j2se/1.6.0/docs/api/java/util/regex/package-summary.html |
---|
| 228 | --> |
---|
| 229 | <filter class="solr.PatternReplaceFilterFactory" |
---|
| 230 | pattern="([^a-z])" replacement="" replace="all" |
---|
| 231 | /> |
---|
| 232 | </analyzer> |
---|
| 233 | </fieldType> |
---|
| 234 | |
---|
| 235 | <!-- since fields of this type are by default not stored or indexed, any data added to |
---|
| 236 | them will be ignored outright |
---|
| 237 | --> |
---|
| 238 | <fieldtype name="ignored" stored="false" indexed="false" class="solr.StrField" /> |
---|
| 239 | |
---|
| 240 | <fieldtype name="html" stored="true" indexed="true" class="solr.TextField"> |
---|
| 241 | <analyzer type="index"> |
---|
| 242 | <charFilter class="solr.HTMLStripCharFilterFactory"/> |
---|
| 243 | <tokenizer class="solr.StandardTokenizerFactory"/> |
---|
| 244 | <!-- in this example, we will only use synonyms at query time |
---|
| 245 | <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/> |
---|
| 246 | --> |
---|
| 247 | <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> |
---|
| 248 | <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/> |
---|
| 249 | <filter class="solr.LowerCaseFilterFactory"/> |
---|
| 250 | <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> |
---|
| 251 | <filter class="solr.PorterStemFilterFactory"/> |
---|
| 252 | <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> |
---|
| 253 | </analyzer> |
---|
| 254 | <analyzer type="query"> |
---|
| 255 | <charFilter class="solr.HTMLStripCharFilterFactory"/> |
---|
| 256 | <tokenizer class="solr.StandardTokenizerFactory"/> |
---|
| 257 | <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> |
---|
| 258 | <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> |
---|
| 259 | <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/> |
---|
| 260 | <filter class="solr.LowerCaseFilterFactory"/> |
---|
| 261 | <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> |
---|
| 262 | <filter class="solr.PorterStemFilterFactory"/> |
---|
| 263 | <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> |
---|
| 264 | </analyzer> |
---|
| 265 | </fieldtype> |
---|
| 266 | |
---|
| 267 | </types> |
---|
| 268 | |
---|
| 269 | |
---|
| 270 | <fields> |
---|
| 271 | <!-- Valid attributes for fields: |
---|
| 272 | name: mandatory - the name for the field |
---|
| 273 | type: mandatory - the name of a previously defined type from the <types> section |
---|
| 274 | indexed: true if this field should be indexed (searchable or sortable) |
---|
| 275 | stored: true if this field should be retrievable |
---|
| 276 | compressed: [false] if this field should be stored using gzip compression |
---|
| 277 | (this will only apply if the field type is compressable; among |
---|
| 278 | the standard field types, only TextField and StrField are) |
---|
| 279 | multiValued: true if this field may contain multiple values per document |
---|
| 280 | omitNorms: (expert) set to true to omit the norms associated with |
---|
| 281 | this field (this disables length normalization and index-time |
---|
| 282 | boosting for the field, and saves some memory). Only full-text |
---|
| 283 | fields or fields that need an index-time boost need norms. |
---|
| 284 | termVectors: [false] set to true to store the term vector for a given field. |
---|
| 285 | When using MoreLikeThis, fields used for similarity should be stored for |
---|
| 286 | best performance. |
---|
| 287 | --> |
---|
| 288 | |
---|
| 289 | <field name="source" type="text" indexed="true" stored="true" /> |
---|
| 290 | <field name="source-link" type="string" indexed="false" stored="true" /> |
---|
| 291 | |
---|
| 292 | <field name="subject" type="text" indexed="true" stored="true" /> |
---|
| 293 | <field name="title" type="text" indexed="true" stored="true" /> |
---|
| 294 | <field name="link" type="string" indexed="true" stored="true" /> |
---|
| 295 | <field name="description" type="html" indexed="true" stored="true" /> |
---|
| 296 | <field name="creator" type="string" indexed="false" stored="true" /> |
---|
| 297 | <field name="item-subject" type="string" indexed="true" stored="false" /> |
---|
| 298 | <field name="date" type="date" indexed="true" stored="false" /> |
---|
| 299 | <field name="slash-department" type="string" indexed="true" stored="false" /> |
---|
| 300 | <field name="slash-section" type="string" indexed="true" stored="false" /> |
---|
| 301 | <field name="slash-comments" type="sint" indexed="true" stored="true" /> |
---|
| 302 | |
---|
| 303 | <field name="all_text" type="text" indexed="true" stored="false" multiValued="true" /> |
---|
| 304 | <copyField source="source" dest="all_text" /> |
---|
| 305 | <copyField source="subject" dest="all_text" /> |
---|
| 306 | <copyField source="title" dest="all_text" /> |
---|
| 307 | <copyField source="description" dest="all_text" /> |
---|
| 308 | <copyField source="creator" dest="all_text" /> |
---|
| 309 | <copyField source="item-subject" dest="all_text" /> |
---|
| 310 | </fields> |
---|
| 311 | |
---|
| 312 | <!-- Field to use to determine and enforce document uniqueness. |
---|
| 313 | Unless this field is marked with required="false", it will be a required field |
---|
| 314 | --> |
---|
| 315 | <uniqueKey>link</uniqueKey> |
---|
| 316 | |
---|
| 317 | <!-- field for the QueryParser to use when an explicit fieldname is absent --> |
---|
| 318 | <defaultSearchField>all_text</defaultSearchField> |
---|
| 319 | |
---|
| 320 | <!-- SolrQueryParser configuration: defaultOperator="AND|OR" --> |
---|
| 321 | <solrQueryParser defaultOperator="OR"/> |
---|
| 322 | |
---|
| 323 | </schema> |
---|