managed-schema 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  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. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!--
  17. This is the Solr schema file. This file should be named "schema.xml" and
  18. should be in the conf directory under the solr home
  19. (i.e. ./solr/conf/schema.xml by default)
  20. or located where the classloader for the Solr webapp can find it.
  21. This example schema is the recommended starting point for users.
  22. It should be kept correct and concise, usable out-of-the-box.
  23. For more information, on how to customize this file, please see
  24. http://wiki.apache.org/solr/SchemaXml
  25. -->
  26. <schema name="example" version="1.6">
  27. <!-- attribute "name" is the name of this schema and is only used for display purposes.
  28. version="x.y" is Solr's version number for the schema syntax and
  29. semantics. It should not normally be changed by applications.
  30. 1.0: multiValued attribute did not exist, all fields are multiValued
  31. by nature
  32. 1.1: multiValued attribute introduced, false by default
  33. 1.2: omitTermFreqAndPositions attribute introduced, true by default
  34. except for text fields.
  35. 1.3: removed optional field compress feature
  36. 1.4: autoGeneratePhraseQueries attribute introduced to drive QueryParser
  37. behavior when a single string produces multiple tokens. Defaults
  38. to off for version >= 1.4
  39. 1.5: omitNorms defaults to true for primitive field types
  40. (int, float, boolean, string...)
  41. 1.6: useDocValuesAsStored defaults to true.
  42. -->
  43. <!-- Valid attributes for fields:
  44. name: mandatory - the name for the field
  45. type: mandatory - the name of a field type from the
  46. <types> fieldType section
  47. indexed: true if this field should be indexed (searchable or sortable)
  48. stored: true if this field should be retrievable
  49. docValues: true if this field should have doc values. Doc values are
  50. useful for faceting, grouping, sorting and function queries. Although not
  51. required, doc values will make the index faster to load, more
  52. NRT-friendly and more memory-efficient. They however come with some
  53. limitations: they are currently only supported by StrField, UUIDField
  54. and all Trie*Fields, and depending on the field type, they might
  55. require the field to be single-valued, be required or have a default
  56. value (check the documentation of the field type you're interested in
  57. for more information)
  58. multiValued: true if this field may contain multiple values per document
  59. omitNorms: (expert) set to true to omit the norms associated with
  60. this field (this disables length normalization and index-time
  61. boosting for the field, and saves some memory). Only full-text
  62. fields or fields that need an index-time boost need norms.
  63. Norms are omitted for primitive (non-analyzed) types by default.
  64. termVectors: [false] set to true to store the term vector for a
  65. given field.
  66. When using MoreLikeThis, fields used for similarity should be
  67. stored for best performance.
  68. termPositions: Store position information with the term vector.
  69. This will increase storage costs.
  70. termOffsets: Store offset information with the term vector. This
  71. will increase storage costs.
  72. required: The field is required. It will throw an error if the
  73. value does not exist
  74. default: a value that should be used if no value is specified
  75. when adding a document.
  76. -->
  77. <!-- field names should consist of alphanumeric or underscore characters only and
  78. not start with a digit. This is not currently strictly enforced,
  79. but other field names will not have first class support from all components
  80. and back compatibility is not guaranteed. Names with both leading and
  81. trailing underscores (e.g. _version_) are reserved.
  82. -->
  83. <!-- If you remove this field, you must _also_ disable the update log in solrconfig.xml
  84. or Solr won't start. _version_ and update log are required for SolrCloud
  85. -->
  86. <field name="_version_" type="long" indexed="true" stored="true"/>
  87. <!-- points to the root document of a block of nested documents. Required for nested
  88. document support, may be removed otherwise
  89. -->
  90. <field name="_root_" type="string" indexed="true" stored="false"/>
  91. <!-- Only remove the "id" field if you have a very good reason to. While not strictly
  92. required, it is highly recommended. A <uniqueKey> is present in almost all Solr
  93. installations. See the <uniqueKey> declaration below where <uniqueKey> is set to "id".
  94. Do NOT change the type and apply index-time analysis to the <uniqueKey> as it will likely
  95. make routing in SolrCloud and document replacement in general fail. Limited _query_ time
  96. analysis is possible as long as the indexing process is guaranteed to index the term
  97. in a compatible way. Any analysis applied to the <uniqueKey> should _not_ produce multiple
  98. tokens
  99. -->
  100. <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
  101. <!-- Dynamic field definitions allow using convention over configuration
  102. for fields via the specification of patterns to match field names.
  103. EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
  104. RESTRICTION: the glob-like pattern in the name attribute must have
  105. a "*" only at the start or the end. -->
  106. <dynamicField name="*_i" type="int" indexed="true" stored="true"/>
  107. <dynamicField name="*_is" type="int" indexed="true" stored="true" multiValued="true"/>
  108. <dynamicField name="*_s" type="string" indexed="true" stored="true" />
  109. <dynamicField name="*_ss" type="string" indexed="true" stored="true" multiValued="true"/>
  110. <dynamicField name="*_l" type="long" indexed="true" stored="true"/>
  111. <dynamicField name="*_ls" type="long" indexed="true" stored="true" multiValued="true"/>
  112. <dynamicField name="*_t" type="text_general" indexed="true" stored="true"/>
  113. <dynamicField name="*_txt" type="text_general" indexed="true" stored="true" multiValued="true"/>
  114. <dynamicField name="*_en" type="text_en" indexed="true" stored="true" multiValued="true"/>
  115. <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
  116. <dynamicField name="*_bs" type="boolean" indexed="true" stored="true" multiValued="true"/>
  117. <dynamicField name="*_f" type="float" indexed="true" stored="true"/>
  118. <dynamicField name="*_fs" type="float" indexed="true" stored="true" multiValued="true"/>
  119. <dynamicField name="*_d" type="double" indexed="true" stored="true"/>
  120. <dynamicField name="*_ds" type="double" indexed="true" stored="true" multiValued="true"/>
  121. <!-- Type used to index the lat and lon components for the "location" FieldType -->
  122. <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" />
  123. <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
  124. <dynamicField name="*_dts" type="date" indexed="true" stored="true" multiValued="true"/>
  125. <dynamicField name="*_p" type="location" indexed="true" stored="true"/>
  126. <!-- some trie-coded dynamic fields for faster range queries -->
  127. <dynamicField name="*_ti" type="tint" indexed="true" stored="true"/>
  128. <dynamicField name="*_tl" type="tlong" indexed="true" stored="true"/>
  129. <dynamicField name="*_tf" type="tfloat" indexed="true" stored="true"/>
  130. <dynamicField name="*_td" type="tdouble" indexed="true" stored="true"/>
  131. <dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
  132. <dynamicField name="*_c" type="currency" indexed="true" stored="true"/>
  133. <dynamicField name="ignored_*" type="ignored" multiValued="true"/>
  134. <dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
  135. <dynamicField name="random_*" type="random" />
  136. <!-- uncomment the following to ignore any fields that don't already match an existing
  137. field name or dynamic field, rather than reporting them as an error.
  138. alternately, change the type="ignored" to some other type e.g. "text" if you want
  139. unknown fields indexed and/or stored by default -->
  140. <!--dynamicField name="*" type="ignored" multiValued="true" /-->
  141. <!-- Field to use to determine and enforce document uniqueness.
  142. Unless this field is marked with required="false", it will be a required field
  143. -->
  144. <uniqueKey>id</uniqueKey>
  145. <!-- copyField commands copy one field to another at the time a document
  146. is added to the index. It's used either to index the same field differently,
  147. or to add multiple fields to the same field for easier/faster searching. -->
  148. <!--
  149. <copyField source="title" dest="text"/>
  150. <copyField source="body" dest="text"/>
  151. -->
  152. <!-- field type definitions. The "name" attribute is
  153. just a label to be used by field definitions. The "class"
  154. attribute and any other attributes determine the real
  155. behavior of the fieldType.
  156. Class names starting with "solr" refer to java classes in a
  157. standard package such as org.apache.solr.analysis
  158. -->
  159. <!-- The StrField type is not analyzed, but indexed/stored verbatim.
  160. It supports doc values but in that case the field needs to be
  161. single-valued and either required or have a default value.
  162. -->
  163. <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
  164. <!-- boolean type: "true" or "false" -->
  165. <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
  166. <!-- sortMissingLast and sortMissingFirst attributes are optional attributes are
  167. currently supported on types that are sorted internally as strings
  168. and on numeric types.
  169. This includes "string","boolean", and, as of 3.5 (and 4.x),
  170. int, float, long, date, double, including the "Trie" variants.
  171. - If sortMissingLast="true", then a sort on this field will cause documents
  172. without the field to come after documents with the field,
  173. regardless of the requested sort order (asc or desc).
  174. - If sortMissingFirst="true", then a sort on this field will cause documents
  175. without the field to come before documents with the field,
  176. regardless of the requested sort order.
  177. - If sortMissingLast="false" and sortMissingFirst="false" (the default),
  178. then default lucene sorting will be used which places docs without the
  179. field first in an ascending sort and last in a descending sort.
  180. -->
  181. <!--
  182. Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
  183. These fields support doc values, but they require the field to be
  184. single-valued and either be required or have a default value.
  185. -->
  186. <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
  187. <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
  188. <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
  189. <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
  190. <!--
  191. Numeric field types that index each value at various levels of precision
  192. to accelerate range queries when the number of values between the range
  193. endpoints is large. See the javadoc for NumericRangeQuery for internal
  194. implementation details.
  195. Smaller precisionStep values (specified in bits) will lead to more tokens
  196. indexed per value, slightly larger index size, and faster range queries.
  197. A precisionStep of 0 disables indexing at different precision levels.
  198. -->
  199. <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
  200. <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>
  201. <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>
  202. <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>
  203. <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
  204. is a more restricted form of the canonical representation of dateTime
  205. http://www.w3.org/TR/xmlschema-2/#dateTime
  206. The trailing "Z" designates UTC time and is mandatory.
  207. Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
  208. All other components are mandatory.
  209. Expressions can also be used to denote calculations that should be
  210. performed relative to "NOW" to determine the value, ie...
  211. NOW/HOUR
  212. ... Round to the start of the current hour
  213. NOW-1DAY
  214. ... Exactly 1 day prior to now
  215. NOW/DAY+6MONTHS+3DAYS
  216. ... 6 months and 3 days in the future from the start of
  217. the current day
  218. Consult the TrieDateField javadocs for more information.
  219. Note: For faster range queries, consider the tdate type
  220. -->
  221. <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
  222. <!-- A Trie based date field for faster date range queries and date faceting. -->
  223. <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>
  224. <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
  225. <fieldType name="binary" class="solr.BinaryField"/>
  226. <!-- The "RandomSortField" is not used to store or search any
  227. data. You can declare fields of this type it in your schema
  228. to generate pseudo-random orderings of your docs for sorting
  229. or function purposes. The ordering is generated based on the field
  230. name and the version of the index. As long as the index version
  231. remains unchanged, and the same field name is reused,
  232. the ordering of the docs will be consistent.
  233. If you want different psuedo-random orderings of documents,
  234. for the same version of the index, use a dynamicField and
  235. change the field name in the request.
  236. -->
  237. <fieldType name="random" class="solr.RandomSortField" indexed="true" />
  238. <!-- solr.TextField allows the specification of custom text analyzers
  239. specified as a tokenizer and a list of token filters. Different
  240. analyzers may be specified for indexing and querying.
  241. The optional positionIncrementGap puts space between multiple fields of
  242. this type on the same document, with the purpose of preventing false phrase
  243. matching across fields.
  244. For more info on customizing your analyzer chain, please see
  245. http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
  246. -->
  247. <!-- One can also specify an existing Analyzer class that has a
  248. default constructor via the class attribute on the analyzer element.
  249. Example:
  250. <fieldType name="text_greek" class="solr.TextField">
  251. <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
  252. </fieldType>
  253. -->
  254. <!-- A text field that only splits on whitespace for exact matching of words -->
  255. <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
  256. <analyzer>
  257. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  258. </analyzer>
  259. </fieldType>
  260. <!-- A general text field that has reasonable, generic
  261. cross-language defaults: it tokenizes with StandardTokenizer,
  262. removes stop words from case-insensitive "stopwords.txt"
  263. (empty by default), and down cases. At query time only, it
  264. also applies synonyms. -->
  265. <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
  266. <analyzer type="index">
  267. <tokenizer class="solr.StandardTokenizerFactory"/>
  268. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  269. <!-- in this example, we will only use synonyms at query time
  270. <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  271. -->
  272. <filter class="solr.LowerCaseFilterFactory"/>
  273. </analyzer>
  274. <analyzer type="query">
  275. <tokenizer class="solr.StandardTokenizerFactory"/>
  276. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  277. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  278. <filter class="solr.LowerCaseFilterFactory"/>
  279. </analyzer>
  280. </fieldType>
  281. <!-- A text field with defaults appropriate for English: it
  282. tokenizes with StandardTokenizer, removes English stop words
  283. (lang/stopwords_en.txt), down cases, protects words from protwords.txt, and
  284. finally applies Porter's stemming. The query time analyzer
  285. also applies synonyms from synonyms.txt. -->
  286. <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
  287. <analyzer type="index">
  288. <tokenizer class="solr.StandardTokenizerFactory"/>
  289. <!-- in this example, we will only use synonyms at query time
  290. <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  291. -->
  292. <!-- Case insensitive stop word removal.
  293. -->
  294. <filter class="solr.StopFilterFactory"
  295. ignoreCase="true"
  296. words="lang/stopwords_en.txt"
  297. />
  298. <filter class="solr.LowerCaseFilterFactory"/>
  299. <filter class="solr.EnglishPossessiveFilterFactory"/>
  300. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  301. <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
  302. <filter class="solr.EnglishMinimalStemFilterFactory"/>
  303. -->
  304. <filter class="solr.PorterStemFilterFactory"/>
  305. </analyzer>
  306. <analyzer type="query">
  307. <tokenizer class="solr.StandardTokenizerFactory"/>
  308. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  309. <filter class="solr.StopFilterFactory"
  310. ignoreCase="true"
  311. words="lang/stopwords_en.txt"
  312. />
  313. <filter class="solr.LowerCaseFilterFactory"/>
  314. <filter class="solr.EnglishPossessiveFilterFactory"/>
  315. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  316. <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
  317. <filter class="solr.EnglishMinimalStemFilterFactory"/>
  318. -->
  319. <filter class="solr.PorterStemFilterFactory"/>
  320. </analyzer>
  321. </fieldType>
  322. <!-- A text field with defaults appropriate for English, plus
  323. aggressive word-splitting and autophrase features enabled.
  324. This field is just like text_en, except it adds
  325. WordDelimiterFilter to enable splitting and matching of
  326. words on case-change, alpha numeric boundaries, and
  327. non-alphanumeric chars. This means certain compound word
  328. cases will work, for example query "wi fi" will match
  329. document "WiFi" or "wi-fi".
  330. -->
  331. <fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
  332. <analyzer type="index">
  333. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  334. <!-- in this example, we will only use synonyms at query time
  335. <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  336. -->
  337. <!-- Case insensitive stop word removal.
  338. -->
  339. <filter class="solr.StopFilterFactory"
  340. ignoreCase="true"
  341. words="lang/stopwords_en.txt"
  342. />
  343. <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
  344. <filter class="solr.LowerCaseFilterFactory"/>
  345. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  346. <filter class="solr.PorterStemFilterFactory"/>
  347. </analyzer>
  348. <analyzer type="query">
  349. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  350. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  351. <filter class="solr.StopFilterFactory"
  352. ignoreCase="true"
  353. words="lang/stopwords_en.txt"
  354. />
  355. <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
  356. <filter class="solr.LowerCaseFilterFactory"/>
  357. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  358. <filter class="solr.PorterStemFilterFactory"/>
  359. </analyzer>
  360. </fieldType>
  361. <!-- Less flexible matching, but less false matches. Probably not ideal for product names,
  362. but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
  363. <fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
  364. <analyzer>
  365. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  366. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
  367. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt"/>
  368. <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
  369. <filter class="solr.LowerCaseFilterFactory"/>
  370. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  371. <filter class="solr.EnglishMinimalStemFilterFactory"/>
  372. <!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
  373. possible with WordDelimiterFilter in conjuncton with stemming. -->
  374. <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
  375. </analyzer>
  376. </fieldType>
  377. <!-- Just like text_general except it reverses the characters of
  378. each token, to enable more efficient leading wildcard queries. -->
  379. <fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
  380. <analyzer type="index">
  381. <tokenizer class="solr.StandardTokenizerFactory"/>
  382. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  383. <filter class="solr.LowerCaseFilterFactory"/>
  384. <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
  385. maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
  386. </analyzer>
  387. <analyzer type="query">
  388. <tokenizer class="solr.StandardTokenizerFactory"/>
  389. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  390. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  391. <filter class="solr.LowerCaseFilterFactory"/>
  392. </analyzer>
  393. </fieldType>
  394. <!-- This is an example of using the KeywordTokenizer along
  395. With various TokenFilterFactories to produce a sortable field
  396. that does not include some properties of the source text
  397. -->
  398. <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
  399. <analyzer>
  400. <!-- KeywordTokenizer does no actual tokenizing, so the entire
  401. input string is preserved as a single token
  402. -->
  403. <tokenizer class="solr.KeywordTokenizerFactory"/>
  404. <!-- The LowerCase TokenFilter does what you expect, which can be
  405. when you want your sorting to be case insensitive
  406. -->
  407. <filter class="solr.LowerCaseFilterFactory" />
  408. <!-- The TrimFilter removes any leading or trailing whitespace -->
  409. <filter class="solr.TrimFilterFactory" />
  410. <!-- The PatternReplaceFilter gives you the flexibility to use
  411. Java Regular expression to replace any sequence of characters
  412. matching a pattern with an arbitrary replacement string,
  413. which may include back references to portions of the original
  414. string matched by the pattern.
  415. See the Java Regular Expression documentation for more
  416. information on pattern and replacement string syntax.
  417. http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html
  418. -->
  419. <filter class="solr.PatternReplaceFilterFactory"
  420. pattern="([^a-z])" replacement="" replace="all"
  421. />
  422. </analyzer>
  423. </fieldType>
  424. <!-- lowercases the entire field value, keeping it as a single token. -->
  425. <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
  426. <analyzer>
  427. <tokenizer class="solr.KeywordTokenizerFactory"/>
  428. <filter class="solr.LowerCaseFilterFactory" />
  429. </analyzer>
  430. </fieldType>
  431. <!-- since fields of this type are by default not stored or indexed,
  432. any data added to them will be ignored outright. -->
  433. <fieldType name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
  434. <!-- This point type indexes the coordinates as separate fields (subFields)
  435. If subFieldType is defined, it references a type, and a dynamic field
  436. definition is created matching *___<typename>. Alternately, if
  437. subFieldSuffix is defined, that is used to create the subFields.
  438. Example: if subFieldType="double", then the coordinates would be
  439. indexed in fields myloc_0___double,myloc_1___double.
  440. Example: if subFieldSuffix="_d" then the coordinates would be indexed
  441. in fields myloc_0_d,myloc_1_d
  442. The subFields are an implementation detail of the fieldType, and end
  443. users normally should not need to know about them.
  444. -->
  445. <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
  446. <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
  447. <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
  448. <!-- An alternative geospatial field type new to Solr 4. It supports multiValued and polygon shapes.
  449. For more information about this and other Spatial fields new to Solr 4, see:
  450. http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
  451. -->
  452. <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
  453. geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />
  454. <!-- Spatial rectangle (bounding box) field. It supports most spatial predicates, and has
  455. special relevancy modes: score=overlapRatio|area|area2D (local-param to the query). DocValues is recommended for
  456. relevancy. -->
  457. <fieldType name="bbox" class="solr.BBoxField"
  458. geo="true" distanceUnits="kilometers" numberType="_bbox_coord" />
  459. <fieldType name="_bbox_coord" class="solr.TrieDoubleField" precisionStep="8" docValues="true" stored="false"/>
  460. <!-- Money/currency field type. See http://wiki.apache.org/solr/MoneyFieldType
  461. Parameters:
  462. defaultCurrency: Specifies the default currency if none specified. Defaults to "USD"
  463. precisionStep: Specifies the precisionStep for the TrieLong field used for the amount
  464. providerClass: Lets you plug in other exchange provider backend:
  465. solr.FileExchangeRateProvider is the default and takes one parameter:
  466. currencyConfig: name of an xml file holding exchange rates
  467. solr.OpenExchangeRatesOrgProvider uses rates from openexchangerates.org:
  468. ratesFileLocation: URL or path to rates JSON file (default latest.json on the web)
  469. refreshInterval: Number of minutes between each rates fetch (default: 1440, min: 60)
  470. -->
  471. <fieldType name="currency" class="solr.CurrencyField" precisionStep="8" defaultCurrency="USD" currencyConfig="currency.xml" />
  472. </schema>