managed-schema 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004
  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. PERFORMANCE NOTE: this schema includes many optional features and should not
  26. be used for benchmarking. To improve performance one could
  27. - set stored="false" for all fields possible (esp large fields) when you
  28. only need to search on the field but don't need to return the original
  29. value.
  30. - set indexed="false" if you don't need to search on the field, but only
  31. return the field as a result of searching on other indexed fields.
  32. - remove all unneeded copyField statements
  33. - for best index size and searching performance, set "index" to false
  34. for all general text fields, use copyField to copy them to the
  35. catchall "text" field, and use that for searching.
  36. - For maximum indexing performance, use the ConcurrentUpdateSolrServer
  37. java client.
  38. - Remember to run the JVM in server mode, and use a higher logging level
  39. that avoids logging every request
  40. -->
  41. <schema name="example-data-driven-schema" version="1.6">
  42. <!-- attribute "name" is the name of this schema and is only used for display purposes.
  43. version="x.y" is Solr's version number for the schema syntax and
  44. semantics. It should not normally be changed by applications.
  45. 1.0: multiValued attribute did not exist, all fields are multiValued
  46. by nature
  47. 1.1: multiValued attribute introduced, false by default
  48. 1.2: omitTermFreqAndPositions attribute introduced, true by default
  49. except for text fields.
  50. 1.3: removed optional field compress feature
  51. 1.4: autoGeneratePhraseQueries attribute introduced to drive QueryParser
  52. behavior when a single string produces multiple tokens. Defaults
  53. to off for version >= 1.4
  54. 1.5: omitNorms defaults to true for primitive field types
  55. (int, float, boolean, string...)
  56. 1.6: useDocValuesAsStored defaults to true.
  57. -->
  58. <!-- Valid attributes for fields:
  59. name: mandatory - the name for the field
  60. type: mandatory - the name of a field type from the
  61. <types> fieldType section
  62. indexed: true if this field should be indexed (searchable or sortable)
  63. stored: true if this field should be retrievable
  64. docValues: true if this field should have doc values. Doc values are
  65. useful for faceting, grouping, sorting and function queries. Although not
  66. required, doc values will make the index faster to load, more
  67. NRT-friendly and more memory-efficient. They however come with some
  68. limitations: they are currently only supported by StrField, UUIDField
  69. and all Trie*Fields, and depending on the field type, they might
  70. require the field to be single-valued, be required or have a default
  71. value (check the documentation of the field type you're interested in
  72. for more information)
  73. multiValued: true if this field may contain multiple values per document
  74. omitNorms: (expert) set to true to omit the norms associated with
  75. this field (this disables length normalization and index-time
  76. boosting for the field, and saves some memory). Only full-text
  77. fields or fields that need an index-time boost need norms.
  78. Norms are omitted for primitive (non-analyzed) types by default.
  79. termVectors: [false] set to true to store the term vector for a
  80. given field.
  81. When using MoreLikeThis, fields used for similarity should be
  82. stored for best performance.
  83. termPositions: Store position information with the term vector.
  84. This will increase storage costs.
  85. termOffsets: Store offset information with the term vector. This
  86. will increase storage costs.
  87. required: The field is required. It will throw an error if the
  88. value does not exist
  89. default: a value that should be used if no value is specified
  90. when adding a document.
  91. -->
  92. <!-- field names should consist of alphanumeric or underscore characters only and
  93. not start with a digit. This is not currently strictly enforced,
  94. but other field names will not have first class support from all components
  95. and back compatibility is not guaranteed. Names with both leading and
  96. trailing underscores (e.g. _version_) are reserved.
  97. -->
  98. <!-- In this data_driven_schema_configs configset, only three fields are pre-declared:
  99. id, _version_, and _text_. All other fields will be type guessed and added via the
  100. "add-unknown-fields-to-the-schema" update request processor chain declared
  101. in solrconfig.xml.
  102. Note that many dynamic fields are also defined - you can use them to specify a
  103. field's type via field naming conventions - see below.
  104. WARNING: The _text_ catch-all field will significantly increase your index size.
  105. If you don't need it, consider removing it and the corresponding copyField directive.
  106. -->
  107. <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
  108. <field name="_version_" type="long" indexed="true" stored="true"/>
  109. <field name="_root_" type="string" indexed="true" stored="false"/>
  110. <field name="_text_" type="text_general" indexed="true" stored="false" multiValued="true"/>
  111. <copyField source="*" dest="_text_"/>
  112. <!-- Dynamic field definitions allow using convention over configuration
  113. for fields via the specification of patterns to match field names.
  114. EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
  115. RESTRICTION: the glob-like pattern in the name attribute must have
  116. a "*" only at the start or the end. -->
  117. <dynamicField name="*_i" type="int" indexed="true" stored="true"/>
  118. <dynamicField name="*_is" type="ints" indexed="true" stored="true"/>
  119. <dynamicField name="*_s" type="string" indexed="true" stored="true" />
  120. <dynamicField name="*_ss" type="strings" indexed="true" stored="true"/>
  121. <dynamicField name="*_l" type="long" indexed="true" stored="true"/>
  122. <dynamicField name="*_ls" type="longs" indexed="true" stored="true"/>
  123. <dynamicField name="*_t" type="text_general" indexed="true" stored="true"/>
  124. <dynamicField name="*_txt" type="text_general" indexed="true" stored="true"/>
  125. <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
  126. <dynamicField name="*_bs" type="booleans" indexed="true" stored="true"/>
  127. <dynamicField name="*_f" type="float" indexed="true" stored="true"/>
  128. <dynamicField name="*_fs" type="floats" indexed="true" stored="true"/>
  129. <dynamicField name="*_d" type="double" indexed="true" stored="true"/>
  130. <dynamicField name="*_ds" type="doubles" indexed="true" stored="true"/>
  131. <!-- Type used to index the lat and lon components for the "location" FieldType -->
  132. <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" />
  133. <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
  134. <dynamicField name="*_dts" type="date" indexed="true" stored="true" multiValued="true"/>
  135. <dynamicField name="*_p" type="location" indexed="true" stored="true"/>
  136. <dynamicField name="*_srpt" type="location_rpt" indexed="true" stored="true"/>
  137. <!-- some trie-coded dynamic fields for faster range queries -->
  138. <dynamicField name="*_ti" type="tint" indexed="true" stored="true"/>
  139. <dynamicField name="*_tis" type="tints" indexed="true" stored="true"/>
  140. <dynamicField name="*_tl" type="tlong" indexed="true" stored="true"/>
  141. <dynamicField name="*_tls" type="tlongs" indexed="true" stored="true"/>
  142. <dynamicField name="*_tf" type="tfloat" indexed="true" stored="true"/>
  143. <dynamicField name="*_tfs" type="tfloats" indexed="true" stored="true"/>
  144. <dynamicField name="*_td" type="tdouble" indexed="true" stored="true"/>
  145. <dynamicField name="*_tds" type="tdoubles" indexed="true" stored="true"/>
  146. <dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
  147. <dynamicField name="*_tdts" type="tdates" indexed="true" stored="true"/>
  148. <dynamicField name="*_c" type="currency" indexed="true" stored="true"/>
  149. <dynamicField name="ignored_*" type="ignored" multiValued="true"/>
  150. <dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
  151. <dynamicField name="random_*" type="random" />
  152. <!-- uncomment the following to ignore any fields that don't already match an existing
  153. field name or dynamic field, rather than reporting them as an error.
  154. alternately, change the type="ignored" to some other type e.g. "text" if you want
  155. unknown fields indexed and/or stored by default
  156. NB: use of "*" dynamic fields will disable field type guessing and adding
  157. unknown fields to the schema. -->
  158. <!--dynamicField name="*" type="ignored" multiValued="true" /-->
  159. <!-- Field to use to determine and enforce document uniqueness.
  160. Unless this field is marked with required="false", it will be a required field
  161. -->
  162. <uniqueKey>id</uniqueKey>
  163. <!-- copyField commands copy one field to another at the time a document
  164. is added to the index. It's used either to index the same field differently,
  165. or to add multiple fields to the same field for easier/faster searching.
  166. <copyField source="sourceFieldName" dest="destinationFieldName"/>
  167. -->
  168. <!-- field type definitions. The "name" attribute is
  169. just a label to be used by field definitions. The "class"
  170. attribute and any other attributes determine the real
  171. behavior of the fieldType.
  172. Class names starting with "solr" refer to java classes in a
  173. standard package such as org.apache.solr.analysis
  174. -->
  175. <!-- The StrField type is not analyzed, but indexed/stored verbatim.
  176. It supports doc values but in that case the field needs to be
  177. single-valued and either required or have a default value.
  178. -->
  179. <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
  180. <fieldType name="strings" class="solr.StrField" sortMissingLast="true" multiValued="true"/>
  181. <!-- boolean type: "true" or "false" -->
  182. <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
  183. <fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>
  184. <!-- sortMissingLast and sortMissingFirst attributes are optional attributes are
  185. currently supported on types that are sorted internally as strings
  186. and on numeric types.
  187. This includes "string","boolean", and, as of 3.5 (and 4.x),
  188. int, float, long, date, double, including the "Trie" variants.
  189. - If sortMissingLast="true", then a sort on this field will cause documents
  190. without the field to come after documents with the field,
  191. regardless of the requested sort order (asc or desc).
  192. - If sortMissingFirst="true", then a sort on this field will cause documents
  193. without the field to come before documents with the field,
  194. regardless of the requested sort order.
  195. - If sortMissingLast="false" and sortMissingFirst="false" (the default),
  196. then default lucene sorting will be used which places docs without the
  197. field first in an ascending sort and last in a descending sort.
  198. -->
  199. <!--
  200. Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
  201. These fields support doc values, but they require the field to be
  202. single-valued and either be required or have a default value.
  203. -->
  204. <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
  205. <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
  206. <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
  207. <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
  208. <fieldType name="ints" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0" multiValued="true"/>
  209. <fieldType name="floats" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0" multiValued="true"/>
  210. <fieldType name="longs" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0" multiValued="true"/>
  211. <fieldType name="doubles" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0" multiValued="true"/>
  212. <!--
  213. Numeric field types that index each value at various levels of precision
  214. to accelerate range queries when the number of values between the range
  215. endpoints is large. See the javadoc for NumericRangeQuery for internal
  216. implementation details.
  217. Smaller precisionStep values (specified in bits) will lead to more tokens
  218. indexed per value, slightly larger index size, and faster range queries.
  219. A precisionStep of 0 disables indexing at different precision levels.
  220. -->
  221. <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
  222. <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>
  223. <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>
  224. <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>
  225. <fieldType name="tints" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0" multiValued="true"/>
  226. <fieldType name="tfloats" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0" multiValued="true"/>
  227. <fieldType name="tlongs" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0" multiValued="true"/>
  228. <fieldType name="tdoubles" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0" multiValued="true"/>
  229. <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
  230. is a more restricted form of the canonical representation of dateTime
  231. http://www.w3.org/TR/xmlschema-2/#dateTime
  232. The trailing "Z" designates UTC time and is mandatory.
  233. Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
  234. All other components are mandatory.
  235. Expressions can also be used to denote calculations that should be
  236. performed relative to "NOW" to determine the value, ie...
  237. NOW/HOUR
  238. ... Round to the start of the current hour
  239. NOW-1DAY
  240. ... Exactly 1 day prior to now
  241. NOW/DAY+6MONTHS+3DAYS
  242. ... 6 months and 3 days in the future from the start of
  243. the current day
  244. Consult the TrieDateField javadocs for more information.
  245. Note: For faster range queries, consider the tdate type
  246. -->
  247. <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
  248. <fieldType name="dates" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0" multiValued="true"/>
  249. <!-- A Trie based date field for faster date range queries and date faceting. -->
  250. <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>
  251. <fieldType name="tdates" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0" multiValued="true"/>
  252. <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
  253. <fieldType name="binary" class="solr.BinaryField"/>
  254. <!-- The "RandomSortField" is not used to store or search any
  255. data. You can declare fields of this type it in your schema
  256. to generate pseudo-random orderings of your docs for sorting
  257. or function purposes. The ordering is generated based on the field
  258. name and the version of the index. As long as the index version
  259. remains unchanged, and the same field name is reused,
  260. the ordering of the docs will be consistent.
  261. If you want different psuedo-random orderings of documents,
  262. for the same version of the index, use a dynamicField and
  263. change the field name in the request.
  264. -->
  265. <fieldType name="random" class="solr.RandomSortField" indexed="true" />
  266. <!-- solr.TextField allows the specification of custom text analyzers
  267. specified as a tokenizer and a list of token filters. Different
  268. analyzers may be specified for indexing and querying.
  269. The optional positionIncrementGap puts space between multiple fields of
  270. this type on the same document, with the purpose of preventing false phrase
  271. matching across fields.
  272. For more info on customizing your analyzer chain, please see
  273. http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
  274. -->
  275. <!-- One can also specify an existing Analyzer class that has a
  276. default constructor via the class attribute on the analyzer element.
  277. Example:
  278. <fieldType name="text_greek" class="solr.TextField">
  279. <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
  280. </fieldType>
  281. -->
  282. <!-- A text field that only splits on whitespace for exact matching of words -->
  283. <dynamicField name="*_ws" type="text_ws" indexed="true" stored="true"/>
  284. <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
  285. <analyzer>
  286. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  287. </analyzer>
  288. </fieldType>
  289. <!-- A general text field that has reasonable, generic
  290. cross-language defaults: it tokenizes with StandardTokenizer,
  291. removes stop words from case-insensitive "stopwords.txt"
  292. (empty by default), and down cases. At query time only, it
  293. also applies synonyms.
  294. -->
  295. <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
  296. <analyzer type="index">
  297. <tokenizer class="solr.StandardTokenizerFactory"/>
  298. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  299. <!-- in this example, we will only use synonyms at query time
  300. <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  301. -->
  302. <filter class="solr.LowerCaseFilterFactory"/>
  303. </analyzer>
  304. <analyzer type="query">
  305. <tokenizer class="solr.StandardTokenizerFactory"/>
  306. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  307. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  308. <filter class="solr.LowerCaseFilterFactory"/>
  309. </analyzer>
  310. </fieldType>
  311. <!-- A text field with defaults appropriate for English: it
  312. tokenizes with StandardTokenizer, removes English stop words
  313. (lang/stopwords_en.txt), down cases, protects words from protwords.txt, and
  314. finally applies Porter's stemming. The query time analyzer
  315. also applies synonyms from synonyms.txt. -->
  316. <dynamicField name="*_txt_en" type="text_en" indexed="true" stored="true"/>
  317. <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
  318. <analyzer type="index">
  319. <tokenizer class="solr.StandardTokenizerFactory"/>
  320. <!-- in this example, we will only use synonyms at query time
  321. <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  322. -->
  323. <!-- Case insensitive stop word removal.
  324. -->
  325. <filter class="solr.StopFilterFactory"
  326. ignoreCase="true"
  327. words="lang/stopwords_en.txt"
  328. />
  329. <filter class="solr.LowerCaseFilterFactory"/>
  330. <filter class="solr.EnglishPossessiveFilterFactory"/>
  331. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  332. <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
  333. <filter class="solr.EnglishMinimalStemFilterFactory"/>
  334. -->
  335. <filter class="solr.PorterStemFilterFactory"/>
  336. </analyzer>
  337. <analyzer type="query">
  338. <tokenizer class="solr.StandardTokenizerFactory"/>
  339. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  340. <filter class="solr.StopFilterFactory"
  341. ignoreCase="true"
  342. words="lang/stopwords_en.txt"
  343. />
  344. <filter class="solr.LowerCaseFilterFactory"/>
  345. <filter class="solr.EnglishPossessiveFilterFactory"/>
  346. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  347. <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
  348. <filter class="solr.EnglishMinimalStemFilterFactory"/>
  349. -->
  350. <filter class="solr.PorterStemFilterFactory"/>
  351. </analyzer>
  352. </fieldType>
  353. <!-- A text field with defaults appropriate for English, plus
  354. aggressive word-splitting and autophrase features enabled.
  355. This field is just like text_en, except it adds
  356. WordDelimiterFilter to enable splitting and matching of
  357. words on case-change, alpha numeric boundaries, and
  358. non-alphanumeric chars. This means certain compound word
  359. cases will work, for example query "wi fi" will match
  360. document "WiFi" or "wi-fi".
  361. -->
  362. <dynamicField name="*_txt_en_split" type="text_en_splitting" indexed="true" stored="true"/>
  363. <fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
  364. <analyzer type="index">
  365. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  366. <!-- in this example, we will only use synonyms at query time
  367. <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  368. -->
  369. <!-- Case insensitive stop word removal.
  370. -->
  371. <filter class="solr.StopFilterFactory"
  372. ignoreCase="true"
  373. words="lang/stopwords_en.txt"
  374. />
  375. <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
  376. <filter class="solr.LowerCaseFilterFactory"/>
  377. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  378. <filter class="solr.PorterStemFilterFactory"/>
  379. </analyzer>
  380. <analyzer type="query">
  381. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  382. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  383. <filter class="solr.StopFilterFactory"
  384. ignoreCase="true"
  385. words="lang/stopwords_en.txt"
  386. />
  387. <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
  388. <filter class="solr.LowerCaseFilterFactory"/>
  389. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  390. <filter class="solr.PorterStemFilterFactory"/>
  391. </analyzer>
  392. </fieldType>
  393. <!-- Less flexible matching, but less false matches. Probably not ideal for product names,
  394. but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
  395. <dynamicField name="*_txt_en_split_tight" type="text_en_splitting_tight" indexed="true" stored="true"/>
  396. <fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
  397. <analyzer>
  398. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  399. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
  400. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt"/>
  401. <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
  402. <filter class="solr.LowerCaseFilterFactory"/>
  403. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  404. <filter class="solr.EnglishMinimalStemFilterFactory"/>
  405. <!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
  406. possible with WordDelimiterFilter in conjuncton with stemming. -->
  407. <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
  408. </analyzer>
  409. </fieldType>
  410. <!-- Just like text_general except it reverses the characters of
  411. each token, to enable more efficient leading wildcard queries.
  412. -->
  413. <dynamicField name="*_txt_rev" type="text_general_rev" indexed="true" stored="true"/>
  414. <fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
  415. <analyzer type="index">
  416. <tokenizer class="solr.StandardTokenizerFactory"/>
  417. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  418. <filter class="solr.LowerCaseFilterFactory"/>
  419. <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
  420. maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
  421. </analyzer>
  422. <analyzer type="query">
  423. <tokenizer class="solr.StandardTokenizerFactory"/>
  424. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  425. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  426. <filter class="solr.LowerCaseFilterFactory"/>
  427. </analyzer>
  428. </fieldType>
  429. <dynamicField name="*_phon_en" type="phonetic_en" indexed="true" stored="true"/>
  430. <fieldType name="phonetic_en" stored="false" indexed="true" class="solr.TextField" >
  431. <analyzer>
  432. <tokenizer class="solr.StandardTokenizerFactory"/>
  433. <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
  434. </analyzer>
  435. </fieldType>
  436. <!-- lowercases the entire field value, keeping it as a single token. -->
  437. <dynamicField name="*_s_lower" type="lowercase" indexed="true" stored="true"/>
  438. <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
  439. <analyzer>
  440. <tokenizer class="solr.KeywordTokenizerFactory"/>
  441. <filter class="solr.LowerCaseFilterFactory" />
  442. </analyzer>
  443. </fieldType>
  444. <!--
  445. Example of using PathHierarchyTokenizerFactory at index time, so
  446. queries for paths match documents at that path, or in descendent paths
  447. -->
  448. <dynamicField name="*_descendent_path" type="descendent_path" indexed="true" stored="true"/>
  449. <fieldType name="descendent_path" class="solr.TextField">
  450. <analyzer type="index">
  451. <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
  452. </analyzer>
  453. <analyzer type="query">
  454. <tokenizer class="solr.KeywordTokenizerFactory" />
  455. </analyzer>
  456. </fieldType>
  457. <!--
  458. Example of using PathHierarchyTokenizerFactory at query time, so
  459. queries for paths match documents at that path, or in ancestor paths
  460. -->
  461. <dynamicField name="*_ancestor_path" type="ancestor_path" indexed="true" stored="true"/>
  462. <fieldType name="ancestor_path" class="solr.TextField">
  463. <analyzer type="index">
  464. <tokenizer class="solr.KeywordTokenizerFactory" />
  465. </analyzer>
  466. <analyzer type="query">
  467. <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
  468. </analyzer>
  469. </fieldType>
  470. <!-- since fields of this type are by default not stored or indexed,
  471. any data added to them will be ignored outright. -->
  472. <fieldType name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
  473. <!-- This point type indexes the coordinates as separate fields (subFields)
  474. If subFieldType is defined, it references a type, and a dynamic field
  475. definition is created matching *___<typename>. Alternately, if
  476. subFieldSuffix is defined, that is used to create the subFields.
  477. Example: if subFieldType="double", then the coordinates would be
  478. indexed in fields myloc_0___double,myloc_1___double.
  479. Example: if subFieldSuffix="_d" then the coordinates would be indexed
  480. in fields myloc_0_d,myloc_1_d
  481. The subFields are an implementation detail of the fieldType, and end
  482. users normally should not need to know about them.
  483. -->
  484. <dynamicField name="*_point" type="point" indexed="true" stored="true"/>
  485. <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
  486. <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
  487. <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
  488. <!-- An alternative geospatial field type new to Solr 4. It supports multiValued and polygon shapes.
  489. For more information about this and other Spatial fields new to Solr 4, see:
  490. http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
  491. -->
  492. <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
  493. geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />
  494. <!-- Money/currency field type. See http://wiki.apache.org/solr/MoneyFieldType
  495. Parameters:
  496. defaultCurrency: Specifies the default currency if none specified. Defaults to "USD"
  497. precisionStep: Specifies the precisionStep for the TrieLong field used for the amount
  498. providerClass: Lets you plug in other exchange provider backend:
  499. solr.FileExchangeRateProvider is the default and takes one parameter:
  500. currencyConfig: name of an xml file holding exchange rates
  501. solr.OpenExchangeRatesOrgProvider uses rates from openexchangerates.org:
  502. ratesFileLocation: URL or path to rates JSON file (default latest.json on the web)
  503. refreshInterval: Number of minutes between each rates fetch (default: 1440, min: 60)
  504. -->
  505. <fieldType name="currency" class="solr.CurrencyField" precisionStep="8" defaultCurrency="USD" currencyConfig="currency.xml" />
  506. <!-- some examples for different languages (generally ordered by ISO code) -->
  507. <!-- Arabic -->
  508. <dynamicField name="*_txt_ar" type="text_ar" indexed="true" stored="true"/>
  509. <fieldType name="text_ar" class="solr.TextField" positionIncrementGap="100">
  510. <analyzer>
  511. <tokenizer class="solr.StandardTokenizerFactory"/>
  512. <!-- for any non-arabic -->
  513. <filter class="solr.LowerCaseFilterFactory"/>
  514. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ar.txt" />
  515. <!-- normalizes ﻯ to ﻱ, etc -->
  516. <filter class="solr.ArabicNormalizationFilterFactory"/>
  517. <filter class="solr.ArabicStemFilterFactory"/>
  518. </analyzer>
  519. </fieldType>
  520. <!-- Bulgarian -->
  521. <dynamicField name="*_txt_bg" type="text_bg" indexed="true" stored="true"/>
  522. <fieldType name="text_bg" class="solr.TextField" positionIncrementGap="100">
  523. <analyzer>
  524. <tokenizer class="solr.StandardTokenizerFactory"/>
  525. <filter class="solr.LowerCaseFilterFactory"/>
  526. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_bg.txt" />
  527. <filter class="solr.BulgarianStemFilterFactory"/>
  528. </analyzer>
  529. </fieldType>
  530. <!-- Catalan -->
  531. <dynamicField name="*_txt_ca" type="text_ca" indexed="true" stored="true"/>
  532. <fieldType name="text_ca" class="solr.TextField" positionIncrementGap="100">
  533. <analyzer>
  534. <tokenizer class="solr.StandardTokenizerFactory"/>
  535. <!-- removes l', etc -->
  536. <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ca.txt"/>
  537. <filter class="solr.LowerCaseFilterFactory"/>
  538. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ca.txt" />
  539. <filter class="solr.SnowballPorterFilterFactory" language="Catalan"/>
  540. </analyzer>
  541. </fieldType>
  542. <!-- CJK bigram (see text_ja for a Japanese configuration using morphological analysis) -->
  543. <dynamicField name="*_txt_cjk" type="text_cjk" indexed="true" stored="true"/>
  544. <fieldType name="text_cjk" class="solr.TextField" positionIncrementGap="100">
  545. <analyzer>
  546. <tokenizer class="solr.StandardTokenizerFactory"/>
  547. <!-- normalize width before bigram, as e.g. half-width dakuten combine -->
  548. <filter class="solr.CJKWidthFilterFactory"/>
  549. <!-- for any non-CJK -->
  550. <filter class="solr.LowerCaseFilterFactory"/>
  551. <filter class="solr.CJKBigramFilterFactory"/>
  552. </analyzer>
  553. </fieldType>
  554. <!-- Czech -->
  555. <dynamicField name="*_txt_cz" type="text_cz" indexed="true" stored="true"/>
  556. <fieldType name="text_cz" class="solr.TextField" positionIncrementGap="100">
  557. <analyzer>
  558. <tokenizer class="solr.StandardTokenizerFactory"/>
  559. <filter class="solr.LowerCaseFilterFactory"/>
  560. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_cz.txt" />
  561. <filter class="solr.CzechStemFilterFactory"/>
  562. </analyzer>
  563. </fieldType>
  564. <!-- Danish -->
  565. <dynamicField name="*_txt_da" type="text_da" indexed="true" stored="true"/>
  566. <fieldType name="text_da" class="solr.TextField" positionIncrementGap="100">
  567. <analyzer>
  568. <tokenizer class="solr.StandardTokenizerFactory"/>
  569. <filter class="solr.LowerCaseFilterFactory"/>
  570. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_da.txt" format="snowball" />
  571. <filter class="solr.SnowballPorterFilterFactory" language="Danish"/>
  572. </analyzer>
  573. </fieldType>
  574. <!-- German -->
  575. <dynamicField name="*_txt_de" type="text_de" indexed="true" stored="true"/>
  576. <fieldType name="text_de" class="solr.TextField" positionIncrementGap="100">
  577. <analyzer>
  578. <tokenizer class="solr.StandardTokenizerFactory"/>
  579. <filter class="solr.LowerCaseFilterFactory"/>
  580. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_de.txt" format="snowball" />
  581. <filter class="solr.GermanNormalizationFilterFactory"/>
  582. <filter class="solr.GermanLightStemFilterFactory"/>
  583. <!-- less aggressive: <filter class="solr.GermanMinimalStemFilterFactory"/> -->
  584. <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="German2"/> -->
  585. </analyzer>
  586. </fieldType>
  587. <!-- Greek -->
  588. <dynamicField name="*_txt_el" type="text_el" indexed="true" stored="true"/>
  589. <fieldType name="text_el" class="solr.TextField" positionIncrementGap="100">
  590. <analyzer>
  591. <tokenizer class="solr.StandardTokenizerFactory"/>
  592. <!-- greek specific lowercase for sigma -->
  593. <filter class="solr.GreekLowerCaseFilterFactory"/>
  594. <filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_el.txt" />
  595. <filter class="solr.GreekStemFilterFactory"/>
  596. </analyzer>
  597. </fieldType>
  598. <!-- Spanish -->
  599. <dynamicField name="*_txt_es" type="text_es" indexed="true" stored="true"/>
  600. <fieldType name="text_es" class="solr.TextField" positionIncrementGap="100">
  601. <analyzer>
  602. <tokenizer class="solr.StandardTokenizerFactory"/>
  603. <filter class="solr.LowerCaseFilterFactory"/>
  604. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_es.txt" format="snowball" />
  605. <filter class="solr.SpanishLightStemFilterFactory"/>
  606. <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Spanish"/> -->
  607. </analyzer>
  608. </fieldType>
  609. <!-- Basque -->
  610. <dynamicField name="*_txt_eu" type="text_eu" indexed="true" stored="true"/>
  611. <fieldType name="text_eu" class="solr.TextField" positionIncrementGap="100">
  612. <analyzer>
  613. <tokenizer class="solr.StandardTokenizerFactory"/>
  614. <filter class="solr.LowerCaseFilterFactory"/>
  615. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_eu.txt" />
  616. <filter class="solr.SnowballPorterFilterFactory" language="Basque"/>
  617. </analyzer>
  618. </fieldType>
  619. <!-- Persian -->
  620. <dynamicField name="*_txt_fa" type="text_fa" indexed="true" stored="true"/>
  621. <fieldType name="text_fa" class="solr.TextField" positionIncrementGap="100">
  622. <analyzer>
  623. <!-- for ZWNJ -->
  624. <charFilter class="solr.PersianCharFilterFactory"/>
  625. <tokenizer class="solr.StandardTokenizerFactory"/>
  626. <filter class="solr.LowerCaseFilterFactory"/>
  627. <filter class="solr.ArabicNormalizationFilterFactory"/>
  628. <filter class="solr.PersianNormalizationFilterFactory"/>
  629. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fa.txt" />
  630. </analyzer>
  631. </fieldType>
  632. <!-- Finnish -->
  633. <dynamicField name="*_txt_fi" type="text_fi" indexed="true" stored="true"/>
  634. <fieldType name="text_fi" class="solr.TextField" positionIncrementGap="100">
  635. <analyzer>
  636. <tokenizer class="solr.StandardTokenizerFactory"/>
  637. <filter class="solr.LowerCaseFilterFactory"/>
  638. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fi.txt" format="snowball" />
  639. <filter class="solr.SnowballPorterFilterFactory" language="Finnish"/>
  640. <!-- less aggressive: <filter class="solr.FinnishLightStemFilterFactory"/> -->
  641. </analyzer>
  642. </fieldType>
  643. <!-- French -->
  644. <dynamicField name="*_txt_fr" type="text_fr" indexed="true" stored="true"/>
  645. <fieldType name="text_fr" class="solr.TextField" positionIncrementGap="100">
  646. <analyzer>
  647. <tokenizer class="solr.StandardTokenizerFactory"/>
  648. <!-- removes l', etc -->
  649. <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_fr.txt"/>
  650. <filter class="solr.LowerCaseFilterFactory"/>
  651. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fr.txt" format="snowball" />
  652. <filter class="solr.FrenchLightStemFilterFactory"/>
  653. <!-- less aggressive: <filter class="solr.FrenchMinimalStemFilterFactory"/> -->
  654. <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="French"/> -->
  655. </analyzer>
  656. </fieldType>
  657. <!-- Irish -->
  658. <dynamicField name="*_txt_ga" type="text_ga" indexed="true" stored="true"/>
  659. <fieldType name="text_ga" class="solr.TextField" positionIncrementGap="100">
  660. <analyzer>
  661. <tokenizer class="solr.StandardTokenizerFactory"/>
  662. <!-- removes d', etc -->
  663. <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ga.txt"/>
  664. <!-- removes n-, etc. position increments is intentionally false! -->
  665. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/hyphenations_ga.txt"/>
  666. <filter class="solr.IrishLowerCaseFilterFactory"/>
  667. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ga.txt"/>
  668. <filter class="solr.SnowballPorterFilterFactory" language="Irish"/>
  669. </analyzer>
  670. </fieldType>
  671. <!-- Galician -->
  672. <dynamicField name="*_txt_gl" type="text_gl" indexed="true" stored="true"/>
  673. <fieldType name="text_gl" class="solr.TextField" positionIncrementGap="100">
  674. <analyzer>
  675. <tokenizer class="solr.StandardTokenizerFactory"/>
  676. <filter class="solr.LowerCaseFilterFactory"/>
  677. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_gl.txt" />
  678. <filter class="solr.GalicianStemFilterFactory"/>
  679. <!-- less aggressive: <filter class="solr.GalicianMinimalStemFilterFactory"/> -->
  680. </analyzer>
  681. </fieldType>
  682. <!-- Hindi -->
  683. <dynamicField name="*_txt_hi" type="text_hi" indexed="true" stored="true"/>
  684. <fieldType name="text_hi" class="solr.TextField" positionIncrementGap="100">
  685. <analyzer>
  686. <tokenizer class="solr.StandardTokenizerFactory"/>
  687. <filter class="solr.LowerCaseFilterFactory"/>
  688. <!-- normalizes unicode representation -->
  689. <filter class="solr.IndicNormalizationFilterFactory"/>
  690. <!-- normalizes variation in spelling -->
  691. <filter class="solr.HindiNormalizationFilterFactory"/>
  692. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hi.txt" />
  693. <filter class="solr.HindiStemFilterFactory"/>
  694. </analyzer>
  695. </fieldType>
  696. <!-- Hungarian -->
  697. <dynamicField name="*_txt_hu" type="text_hu" indexed="true" stored="true"/>
  698. <fieldType name="text_hu" class="solr.TextField" positionIncrementGap="100">
  699. <analyzer>
  700. <tokenizer class="solr.StandardTokenizerFactory"/>
  701. <filter class="solr.LowerCaseFilterFactory"/>
  702. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hu.txt" format="snowball" />
  703. <filter class="solr.SnowballPorterFilterFactory" language="Hungarian"/>
  704. <!-- less aggressive: <filter class="solr.HungarianLightStemFilterFactory"/> -->
  705. </analyzer>
  706. </fieldType>
  707. <!-- Armenian -->
  708. <dynamicField name="*_txt_hy" type="text_hy" indexed="true" stored="true"/>
  709. <fieldType name="text_hy" class="solr.TextField" positionIncrementGap="100">
  710. <analyzer>
  711. <tokenizer class="solr.StandardTokenizerFactory"/>
  712. <filter class="solr.LowerCaseFilterFactory"/>
  713. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hy.txt" />
  714. <filter class="solr.SnowballPorterFilterFactory" language="Armenian"/>
  715. </analyzer>
  716. </fieldType>
  717. <!-- Indonesian -->
  718. <dynamicField name="*_txt_id" type="text_id" indexed="true" stored="true"/>
  719. <fieldType name="text_id" class="solr.TextField" positionIncrementGap="100">
  720. <analyzer>
  721. <tokenizer class="solr.StandardTokenizerFactory"/>
  722. <filter class="solr.LowerCaseFilterFactory"/>
  723. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_id.txt" />
  724. <!-- for a less aggressive approach (only inflectional suffixes), set stemDerivational to false -->
  725. <filter class="solr.IndonesianStemFilterFactory" stemDerivational="true"/>
  726. </analyzer>
  727. </fieldType>
  728. <!-- Italian -->
  729. <dynamicField name="*_txt_it" type="text_it" indexed="true" stored="true"/>
  730. <fieldType name="text_it" class="solr.TextField" positionIncrementGap="100">
  731. <analyzer>
  732. <tokenizer class="solr.StandardTokenizerFactory"/>
  733. <!-- removes l', etc -->
  734. <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_it.txt"/>
  735. <filter class="solr.LowerCaseFilterFactory"/>
  736. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_it.txt" format="snowball" />
  737. <filter class="solr.ItalianLightStemFilterFactory"/>
  738. <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Italian"/> -->
  739. </analyzer>
  740. </fieldType>
  741. <!-- Japanese using morphological analysis (see text_cjk for a configuration using bigramming)
  742. NOTE: If you want to optimize search for precision, use default operator AND in your query
  743. parser config with <solrQueryParser defaultOperator="AND"/> further down in this file. Use
  744. OR if you would like to optimize for recall (default).
  745. -->
  746. <dynamicField name="*_txt_ja" type="text_ja" indexed="true" stored="true"/>
  747. <fieldType name="text_ja" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="false">
  748. <analyzer>
  749. <!-- Kuromoji Japanese morphological analyzer/tokenizer (JapaneseTokenizer)
  750. Kuromoji has a search mode (default) that does segmentation useful for search. A heuristic
  751. is used to segment compounds into its parts and the compound itself is kept as synonym.
  752. Valid values for attribute mode are:
  753. normal: regular segmentation
  754. search: segmentation useful for search with synonyms compounds (default)
  755. extended: same as search mode, but unigrams unknown words (experimental)
  756. For some applications it might be good to use search mode for indexing and normal mode for
  757. queries to reduce recall and prevent parts of compounds from being matched and highlighted.
  758. Use <analyzer type="index"> and <analyzer type="query"> for this and mode normal in query.
  759. Kuromoji also has a convenient user dictionary feature that allows overriding the statistical
  760. model with your own entries for segmentation, part-of-speech tags and readings without a need
  761. to specify weights. Notice that user dictionaries have not been subject to extensive testing.
  762. User dictionary attributes are:
  763. userDictionary: user dictionary filename
  764. userDictionaryEncoding: user dictionary encoding (default is UTF-8)
  765. See lang/userdict_ja.txt for a sample user dictionary file.
  766. Punctuation characters are discarded by default. Use discardPunctuation="false" to keep them.
  767. See http://wiki.apache.org/solr/JapaneseLanguageSupport for more on Japanese language support.
  768. -->
  769. <tokenizer class="solr.JapaneseTokenizerFactory" mode="search"/>
  770. <!--<tokenizer class="solr.JapaneseTokenizerFactory" mode="search" userDictionary="lang/userdict_ja.txt"/>-->
  771. <!-- Reduces inflected verbs and adjectives to their base/dictionary forms (辞書形) -->
  772. <filter class="solr.JapaneseBaseFormFilterFactory"/>
  773. <!-- Removes tokens with certain part-of-speech tags -->
  774. <filter class="solr.JapanesePartOfSpeechStopFilterFactory" tags="lang/stoptags_ja.txt" />
  775. <!-- Normalizes full-width romaji to half-width and half-width kana to full-width (Unicode NFKC subset) -->
  776. <filter class="solr.CJKWidthFilterFactory"/>
  777. <!-- Removes common tokens typically not useful for search, but have a negative effect on ranking -->
  778. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ja.txt" />
  779. <!-- Normalizes common katakana spelling variations by removing any last long sound character (U+30FC) -->
  780. <filter class="solr.JapaneseKatakanaStemFilterFactory" minimumLength="4"/>
  781. <!-- Lower-cases romaji characters -->
  782. <filter class="solr.LowerCaseFilterFactory"/>
  783. </analyzer>
  784. </fieldType>
  785. <!-- Latvian -->
  786. <dynamicField name="*_txt_lv" type="text_lv" indexed="true" stored="true"/>
  787. <fieldType name="text_lv" class="solr.TextField" positionIncrementGap="100">
  788. <analyzer>
  789. <tokenizer class="solr.StandardTokenizerFactory"/>
  790. <filter class="solr.LowerCaseFilterFactory"/>
  791. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_lv.txt" />
  792. <filter class="solr.LatvianStemFilterFactory"/>
  793. </analyzer>
  794. </fieldType>
  795. <!-- Dutch -->
  796. <dynamicField name="*_txt_nl" type="text_nl" indexed="true" stored="true"/>
  797. <fieldType name="text_nl" class="solr.TextField" positionIncrementGap="100">
  798. <analyzer>
  799. <tokenizer class="solr.StandardTokenizerFactory"/>
  800. <filter class="solr.LowerCaseFilterFactory"/>
  801. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_nl.txt" format="snowball" />
  802. <filter class="solr.StemmerOverrideFilterFactory" dictionary="lang/stemdict_nl.txt" ignoreCase="false"/>
  803. <filter class="solr.SnowballPorterFilterFactory" language="Dutch"/>
  804. </analyzer>
  805. </fieldType>
  806. <!-- Norwegian -->
  807. <dynamicField name="*_txt_no" type="text_no" indexed="true" stored="true"/>
  808. <fieldType name="text_no" class="solr.TextField" positionIncrementGap="100">
  809. <analyzer>
  810. <tokenizer class="solr.StandardTokenizerFactory"/>
  811. <filter class="solr.LowerCaseFilterFactory"/>
  812. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_no.txt" format="snowball" />
  813. <filter class="solr.SnowballPorterFilterFactory" language="Norwegian"/>
  814. <!-- less aggressive: <filter class="solr.NorwegianLightStemFilterFactory"/> -->
  815. <!-- singular/plural: <filter class="solr.NorwegianMinimalStemFilterFactory"/> -->
  816. </analyzer>
  817. </fieldType>
  818. <!-- Portuguese -->
  819. <dynamicField name="*_txt_pt" type="text_pt" indexed="true" stored="true"/>
  820. <fieldType name="text_pt" class="solr.TextField" positionIncrementGap="100">
  821. <analyzer>
  822. <tokenizer class="solr.StandardTokenizerFactory"/>
  823. <filter class="solr.LowerCaseFilterFactory"/>
  824. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pt.txt" format="snowball" />
  825. <filter class="solr.PortugueseLightStemFilterFactory"/>
  826. <!-- less aggressive: <filter class="solr.PortugueseMinimalStemFilterFactory"/> -->
  827. <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Portuguese"/> -->
  828. <!-- most aggressive: <filter class="solr.PortugueseStemFilterFactory"/> -->
  829. </analyzer>
  830. </fieldType>
  831. <!-- Romanian -->
  832. <dynamicField name="*_txt_ro" type="text_ro" indexed="true" stored="true"/>
  833. <fieldType name="text_ro" class="solr.TextField" positionIncrementGap="100">
  834. <analyzer>
  835. <tokenizer class="solr.StandardTokenizerFactory"/>
  836. <filter class="solr.LowerCaseFilterFactory"/>
  837. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ro.txt" />
  838. <filter class="solr.SnowballPorterFilterFactory" language="Romanian"/>
  839. </analyzer>
  840. </fieldType>
  841. <!-- Russian -->
  842. <dynamicField name="*_txt_ru" type="text_ru" indexed="true" stored="true"/>
  843. <fieldType name="text_ru" class="solr.TextField" positionIncrementGap="100">
  844. <analyzer>
  845. <tokenizer class="solr.StandardTokenizerFactory"/>
  846. <filter class="solr.LowerCaseFilterFactory"/>
  847. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ru.txt" format="snowball" />
  848. <filter class="solr.SnowballPorterFilterFactory" language="Russian"/>
  849. <!-- less aggressive: <filter class="solr.RussianLightStemFilterFactory"/> -->
  850. </analyzer>
  851. </fieldType>
  852. <!-- Swedish -->
  853. <dynamicField name="*_txt_sv" type="text_sv" indexed="true" stored="true"/>
  854. <fieldType name="text_sv" class="solr.TextField" positionIncrementGap="100">
  855. <analyzer>
  856. <tokenizer class="solr.StandardTokenizerFactory"/>
  857. <filter class="solr.LowerCaseFilterFactory"/>
  858. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_sv.txt" format="snowball" />
  859. <filter class="solr.SnowballPorterFilterFactory" language="Swedish"/>
  860. <!-- less aggressive: <filter class="solr.SwedishLightStemFilterFactory"/> -->
  861. </analyzer>
  862. </fieldType>
  863. <!-- Thai -->
  864. <dynamicField name="*_txt_th" type="text_th" indexed="true" stored="true"/>
  865. <fieldType name="text_th" class="solr.TextField" positionIncrementGap="100">
  866. <analyzer>
  867. <tokenizer class="solr.ThaiTokenizerFactory"/>
  868. <filter class="solr.LowerCaseFilterFactory"/>
  869. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_th.txt" />
  870. </analyzer>
  871. </fieldType>
  872. <!-- Turkish -->
  873. <dynamicField name="*_txt_tr" type="text_tr" indexed="true" stored="true"/>
  874. <fieldType name="text_tr" class="solr.TextField" positionIncrementGap="100">
  875. <analyzer>
  876. <tokenizer class="solr.StandardTokenizerFactory"/>
  877. <filter class="solr.TurkishLowerCaseFilterFactory"/>
  878. <filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_tr.txt" />
  879. <filter class="solr.SnowballPorterFilterFactory" language="Turkish"/>
  880. </analyzer>
  881. </fieldType>
  882. <!-- Similarity is the scoring routine for each document vs. a query.
  883. A custom Similarity or SimilarityFactory may be specified here, but
  884. the default is fine for most applications.
  885. For more info: http://wiki.apache.org/solr/SchemaXml#Similarity
  886. -->
  887. <!--
  888. <similarity class="com.example.solr.CustomSimilarityFactory">
  889. <str name="paramkey">param value</str>
  890. </similarity>
  891. -->
  892. <useDocValuesAsStored>false</useDocValuesAsStored>
  893. </schema>