Guest User

schema

a guest
Mar 27th, 2014
544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 56.30 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9.  
  10. http://www.apache.org/licenses/LICENSE-2.0
  11.  
  12. Unless required by applicable law or agreed to in writing, software
  13. distributed under the License is distributed on an "AS IS" BASIS,
  14. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. See the License for the specific language governing permissions and
  16. limitations under the License.
  17. -->
  18.  
  19. <!--
  20. This is the Solr schema file. This file should be named "schema.xml" and
  21. should be in the conf directory under the solr home
  22. (i.e. ./solr/conf/schema.xml by default)
  23. or located where the classloader for the Solr webapp can find it.
  24.  
  25. This example schema is the recommended starting point for users.
  26. It should be kept correct and concise, usable out-of-the-box.
  27.  
  28. For more information, on how to customize this file, please see
  29. http://wiki.apache.org/solr/SchemaXml
  30.  
  31. PERFORMANCE NOTE: this schema includes many optional features and should not
  32. be used for benchmarking. To improve performance one could
  33. - set stored="false" for all fields possible (esp large fields) when you
  34. only need to search on the field but don't need to return the original
  35. value.
  36. - set indexed="false" if you don't need to search on the field, but only
  37. return the field as a result of searching on other indexed fields.
  38. - remove all unneeded copyField statements
  39. - for best index size and searching performance, set "index" to false
  40. for all general text fields, use copyField to copy them to the
  41. catchall "text" field, and use that for searching.
  42. - For maximum indexing performance, use the StreamingUpdateSolrServer
  43. java client.
  44. - Remember to run the JVM in server mode, and use a higher logging level
  45. that avoids logging every request
  46. -->
  47.  
  48. <schema name="example" version="1.5">
  49. <!-- attribute "name" is the name of this schema and is only used for display purposes.
  50. version="x.y" is Solr's version number for the schema syntax and
  51. semantics. It should not normally be changed by applications.
  52.  
  53. 1.0: multiValued attribute did not exist, all fields are multiValued
  54. by nature
  55. 1.1: multiValued attribute introduced, false by default
  56. 1.2: omitTermFreqAndPositions attribute introduced, true by default
  57. except for text fields.
  58. 1.3: removed optional field compress feature
  59. 1.4: autoGeneratePhraseQueries attribute introduced to drive QueryParser
  60. behavior when a single string produces multiple tokens. Defaults
  61. to off for version >= 1.4
  62. 1.5: omitNorms defaults to true for primitive field types
  63. (int, float, boolean, string...)
  64. -->
  65.  
  66. <fields>
  67.  
  68. <field name="id" type="string" indexed="true" stored="true" required="true"/> <!--multiValued="false"/-->
  69. <field name="doctype" type="lowercase" indexed="true" stored="true" required="false" />
  70. <field name="title" type="text_en_splitting_tight" indexed="true" stored="true" multiValued="true"/>
  71. <field name="full_text_stx" type="text_stx" indexed="true" stored="false" multiValued="true"/>
  72. <field name="time_start" type="tdate" indexed="true" stored="true"/>
  73. <field name="time_end" type="tdate" indexed="true" stored="true"/>
  74. <field name="full_text_dds" type="text_stx" indexed="true" stored="false" multiValued="true"/>
  75. <field name="best_id" type="text_stx" indexed="true" stored="true" multiValued="true"/>
  76.  
  77. <!--field name="Bst_Beschreibung_stx" type="text_stx" indexed="true" stored="true"/-->
  78. <field name="perm_dockey" type="string" indexed="true" stored="true"/>
  79. <field name="denied_users" type="string" indexed="true" stored="true" multiValued="true"/>
  80. <field name="permission" type="string" indexed="true" stored="true"/>
  81.  
  82.  
  83.  
  84. <!-- Main body of document extracted by SolrCell.
  85. NOTE: This field is not indexed by default, since it is also copied to "text"
  86. using copyField below. This is to save space. Use this field for returning and
  87. highlighting document content. Use the "text" field to search the content. -->
  88. <field name="content" type="text_general" indexed="false" stored="true" multiValued="true"/>
  89.  
  90.  
  91. <!-- catchall field, containing all other searchable text fields (implemented
  92. via copyField further on in this schema -->
  93. <field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>
  94.  
  95. <!-- catchall text field that indexes tokens both normally and in reverse for efficient
  96. leading wildcard queries. -->
  97. <field name="text_rev" type="text_general_rev" indexed="true" stored="false" multiValued="true"/>
  98.  
  99. <!-- non-tokenized version of manufacturer to make it easier to sort or group
  100. results by manufacturer. copied from "manu" via copyField -->
  101. <field name="manu_exact" type="string" indexed="true" stored="false"/>
  102.  
  103. <field name="payloads" type="payloads" indexed="true" stored="true"/>
  104.  
  105. <field name="_version_" type="long" indexed="true" stored="true"/>
  106.  
  107. <!-- Uncommenting the following will create a "timestamp" field using
  108. a default value of "NOW" to indicate when each document was indexed.
  109. -->
  110. <!--
  111. <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
  112. -->
  113.  
  114. <!-- Dynamic field definitions allow using convention over configuration
  115. for fields via the specification of patterns to match field names.
  116. EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
  117. RESTRICTION: the glob-like pattern in the name attribute must have
  118. a "*" only at the start or the end. -->
  119.  
  120. <dynamicField name="*_stx_i" type="int" indexed="true" stored="true"/>
  121. <dynamicField name="*_stx_f" type="float" indexed="true" stored="true"/>
  122. <dynamicField name="*_stx_b" type="boolean" indexed="true" stored="true"/>
  123. <dynamicField name="*_stx_time_start" type="tdate" indexed="true" stored="true"/>
  124. <dynamicField name="*_stx_time_end" type="tdate" indexed="true" stored="true"/>
  125.  
  126. <dynamicField name="*_stx_time_range" type="time_range_stx" indexed="true" stored="true" omitNorms="true" multiValued="true"/>
  127.  
  128. <dynamicField name="*_stx_no_delim" type="lowercase" indexed="true" stored="true"/>
  129. <dynamicField name="*_stx_no_fulltext" type="text_stx" indexed="true" stored="true"/>
  130. <dynamicField name="*_stx" type="text_stx" indexed="true" stored="true" omitNorms="true" multiValued="true"/>
  131. <dynamicField name="*_dds" type="text_stx" indexed="true" stored="false" omitNorms="true" multiValued="true"/>
  132.  
  133. </fields>
  134.  
  135. <uniqueKey>id</uniqueKey>
  136.  
  137. <!-- DEPRECATED: The defaultSearchField is consulted by various query parsers when
  138. parsing a query string that isn't explicit about the field. Machine (non-user)
  139. generated queries are best made explicit, or they can use the "df" request parameter
  140. which takes precedence over this.
  141. Note: Un-commenting defaultSearchField will be insufficient if your request handler
  142. in solrconfig.xml defines "df", which takes precedence. That would need to be removed.
  143. <defaultSearchField>text</defaultSearchField> -->
  144.  
  145. <defaultSearchField>full_text_stx</defaultSearchField>
  146.  
  147. <!-- DEPRECATED: The defaultOperator (AND|OR) is consulted by various query parsers
  148. when parsing a query string to determine if a clause of the query should be marked as
  149. required or optional, assuming the clause isn't already marked by some operator.
  150. The default is OR, which is generally assumed so it is not a good idea to change it
  151. globally here. The "q.op" request parameter takes precedence over this.
  152. <solrQueryParser defaultOperator="OR"/> -->
  153.  
  154. <solrQueryParser defaultOperator="AND"/>
  155.  
  156. <!-- copyField commands copy one field to another at the time a document
  157. is added to the index. It's used either to index the same field differently,
  158. or to add multiple fields to the same field for easier/faster searching. -->
  159.  
  160. <!--copyField source="cat" dest="text"/>
  161. <copyField source="name" dest="text"/>
  162. <copyField source="manu" dest="text"/>
  163. <copyField source="features" dest="text"/>
  164. <copyField source="includes" dest="text"/>
  165. <copyField source="manu" dest="manu_exact"/-->
  166.  
  167. <!-- Copy the price into a currency enabled field (default USD) -->
  168. <!--copyField source="price" dest="price_c"/-->
  169.  
  170. <!-- Text fields from SolrCell to search by default in our catch-all field -->
  171. <!--copyField source="title" dest="text"/>
  172. <copyField source="author" dest="text"/>
  173. <copyField source="description" dest="text"/>
  174. <copyField source="keywords" dest="text"/>
  175. <copyField source="content" dest="text"/>
  176. <copyField source="content_type" dest="text"/>
  177. <copyField source="resourcename" dest="text"/>
  178. <copyField source="url" dest="text"/-->
  179.  
  180. <!-- Create a string version of author for faceting -->
  181. <!--copyField source="author" dest="author_s"/-->
  182.  
  183. <!-- Above, multiple source fields are copied to the [text] field.
  184. Another way to map multiple source fields to the same
  185. destination field is to use the dynamic field syntax.
  186. copyField also supports a maxChars to copy setting. -->
  187.  
  188. <!-- <copyField source="*_t" dest="text" maxChars="3000"/> -->
  189.  
  190. <!-- copy name to alphaNameSort, a field designed for sorting by name -->
  191. <!-- <copyField source="name" dest="alphaNameSort"/> -->
  192.  
  193. <copyField source="*_stx" dest="full_text_stx"/>
  194. <copyField source="*_stx_i" dest="full_text_stx"/>
  195. <copyField source="*_stx_f" dest="full_text_stx"/>
  196. <copyField source="*_stx_b" dest="full_text_stx"/>
  197. <copyField source="*_stx_time_range" dest="full_stx_time_range"/>
  198. <copyField source="*_stx_no_delim" dest="full_text_stx"/>
  199. <copyField source="Vz_Best_stx_no_fulltext" dest="best_id"/>
  200. <copyField source="Bst_Id_stx_no_fulltext" dest="best_id"/>
  201. <!--copyField source="best_id" dest="full_text_stx"/-->
  202. <copyField source="*_dds" dest="full_text_dds"/>
  203.  
  204.  
  205. <types>
  206. <!-- field type definitions. The "name" attribute is
  207. just a label to be used by field definitions. The "class"
  208. attribute and any other attributes determine the real
  209. behavior of the fieldType.
  210. Class names starting with "solr" refer to java classes in a
  211. standard package such as org.apache.solr.analysis
  212. -->
  213.  
  214. <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
  215. <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
  216.  
  217. <!-- boolean type: "true" or "false" -->
  218. <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
  219.  
  220. <!-- sortMissingLast and sortMissingFirst attributes are optional attributes are
  221. currently supported on types that are sorted internally as strings
  222. and on numeric types.
  223. This includes "string","boolean", and, as of 3.5 (and 4.x),
  224. int, float, long, date, double, including the "Trie" variants.
  225. - If sortMissingLast="true", then a sort on this field will cause documents
  226. without the field to come after documents with the field,
  227. regardless of the requested sort order (asc or desc).
  228. - If sortMissingFirst="true", then a sort on this field will cause documents
  229. without the field to come before documents with the field,
  230. regardless of the requested sort order.
  231. - If sortMissingLast="false" and sortMissingFirst="false" (the default),
  232. then default lucene sorting will be used which places docs without the
  233. field first in an ascending sort and last in a descending sort.
  234. -->
  235.  
  236. <!--
  237. Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
  238. -->
  239. <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
  240. <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
  241. <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
  242. <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
  243.  
  244. <!--
  245. Numeric field types that index each value at various levels of precision
  246. to accelerate range queries when the number of values between the range
  247. endpoints is large. See the javadoc for NumericRangeQuery for internal
  248. implementation details.
  249.  
  250. Smaller precisionStep values (specified in bits) will lead to more tokens
  251. indexed per value, slightly larger index size, and faster range queries.
  252. A precisionStep of 0 disables indexing at different precision levels.
  253. -->
  254. <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
  255. <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>
  256. <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>
  257. <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>
  258.  
  259. <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
  260. is a more restricted form of the canonical representation of dateTime
  261. http://www.w3.org/TR/xmlschema-2/#dateTime
  262. The trailing "Z" designates UTC time and is mandatory.
  263. Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
  264. All other components are mandatory.
  265.  
  266. Expressions can also be used to denote calculations that should be
  267. performed relative to "NOW" to determine the value, ie...
  268.  
  269. NOW/HOUR
  270. ... Round to the start of the current hour
  271. NOW-1DAY
  272. ... Exactly 1 day prior to now
  273. NOW/DAY+6MONTHS+3DAYS
  274. ... 6 months and 3 days in the future from the start of
  275. the current day
  276.  
  277. Consult the DateField javadocs for more information.
  278.  
  279. Note: For faster range queries, consider the tdate type
  280. -->
  281. <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
  282.  
  283. <!-- A Trie based date field for faster date range queries and date faceting. -->
  284. <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>
  285.  
  286.  
  287. <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
  288. <fieldtype name="binary" class="solr.BinaryField"/>
  289.  
  290. <!--
  291. Note:
  292. These should only be used for compatibility with existing indexes (created with lucene or older Solr versions).
  293. Use Trie based fields instead. As of Solr 3.5 and 4.x, Trie based fields support sortMissingFirst/Last
  294.  
  295. Plain numeric field types that store and index the text
  296. value verbatim (and hence don't correctly support range queries, since the
  297. lexicographic ordering isn't equal to the numeric ordering)
  298. -->
  299. <fieldType name="pint" class="solr.IntField"/>
  300. <fieldType name="plong" class="solr.LongField"/>
  301. <fieldType name="pfloat" class="solr.FloatField"/>
  302. <fieldType name="pdouble" class="solr.DoubleField"/>
  303. <fieldType name="pdate" class="solr.DateField" sortMissingLast="true"/>
  304.  
  305. <!-- The "RandomSortField" is not used to store or search any
  306. data. You can declare fields of this type it in your schema
  307. to generate pseudo-random orderings of your docs for sorting
  308. or function purposes. The ordering is generated based on the field
  309. name and the version of the index. As long as the index version
  310. remains unchanged, and the same field name is reused,
  311. the ordering of the docs will be consistent.
  312. If you want different psuedo-random orderings of documents,
  313. for the same version of the index, use a dynamicField and
  314. change the field name in the request.
  315. -->
  316. <fieldType name="random" class="solr.RandomSortField" indexed="true" />
  317.  
  318. <!-- solr.TextField allows the specification of custom text analyzers
  319. specified as a tokenizer and a list of token filters. Different
  320. analyzers may be specified for indexing and querying.
  321.  
  322. The optional positionIncrementGap puts space between multiple fields of
  323. this type on the same document, with the purpose of preventing false phrase
  324. matching across fields.
  325.  
  326. For more info on customizing your analyzer chain, please see
  327. http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
  328. -->
  329.  
  330. <!-- One can also specify an existing Analyzer class that has a
  331. default constructor via the class attribute on the analyzer element.
  332. Example:
  333. <fieldType name="text_greek" class="solr.TextField">
  334. <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
  335. </fieldType>
  336. -->
  337.  
  338. <!-- A text field that only splits on whitespace for exact matching of words -->
  339. <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
  340. <analyzer>
  341. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  342. </analyzer>
  343. </fieldType>
  344.  
  345. <!-- A general text field that has reasonable, generic
  346. cross-language defaults: it tokenizes with StandardTokenizer,
  347. removes stop words from case-insensitive "stopwords.txt"
  348. (empty by default), and down cases. At query time only, it
  349. also applies synonyms. -->
  350. <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
  351. <analyzer type="index">
  352. <tokenizer class="solr.StandardTokenizerFactory"/>
  353. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
  354. <!-- in this example, we will only use synonyms at query time
  355. <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  356. -->
  357. <filter class="solr.LowerCaseFilterFactory"/>
  358. </analyzer>
  359. <analyzer type="query">
  360. <tokenizer class="solr.StandardTokenizerFactory"/>
  361. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
  362. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  363. <filter class="solr.LowerCaseFilterFactory"/>
  364. </analyzer>
  365. </fieldType>
  366.  
  367. <!-- A text field with defaults appropriate for English: it
  368. tokenizes with StandardTokenizer, removes English stop words
  369. (lang/stopwords_en.txt), down cases, protects words from protwords.txt, and
  370. finally applies Porter's stemming. The query time analyzer
  371. also applies synonyms from synonyms.txt. -->
  372. <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
  373. <analyzer type="index">
  374. <tokenizer class="solr.StandardTokenizerFactory"/>
  375. <!-- in this example, we will only use synonyms at query time
  376. <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  377. -->
  378. <!-- Case insensitive stop word removal.
  379. add enablePositionIncrements=true in both the index and query
  380. analyzers to leave a 'gap' for more accurate phrase queries.
  381. -->
  382. <filter class="solr.StopFilterFactory"
  383. ignoreCase="true"
  384. words="lang/stopwords_en.txt"
  385. enablePositionIncrements="true"
  386. />
  387. <filter class="solr.LowerCaseFilterFactory"/>
  388. <filter class="solr.EnglishPossessiveFilterFactory"/>
  389. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  390. <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
  391. <filter class="solr.EnglishMinimalStemFilterFactory"/>
  392. -->
  393. <filter class="solr.PorterStemFilterFactory"/>
  394. </analyzer>
  395. <analyzer type="query">
  396. <tokenizer class="solr.StandardTokenizerFactory"/>
  397. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  398. <filter class="solr.StopFilterFactory"
  399. ignoreCase="true"
  400. words="lang/stopwords_en.txt"
  401. enablePositionIncrements="true"
  402. />
  403. <filter class="solr.LowerCaseFilterFactory"/>
  404. <filter class="solr.EnglishPossessiveFilterFactory"/>
  405. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  406. <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
  407. <filter class="solr.EnglishMinimalStemFilterFactory"/>
  408. -->
  409. <filter class="solr.PorterStemFilterFactory"/>
  410. </analyzer>
  411. </fieldType>
  412.  
  413. <!-- A text field with defaults appropriate for English, plus
  414. aggressive word-splitting and autophrase features enabled.
  415. This field is just like text_en, except it adds
  416. WordDelimiterFilter to enable splitting and matching of
  417. words on case-change, alpha numeric boundaries, and
  418. non-alphanumeric chars. This means certain compound word
  419. cases will work, for example query "wi fi" will match
  420. document "WiFi" or "wi-fi".
  421. -->
  422. <fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
  423. <analyzer type="index">
  424. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  425. <!-- in this example, we will only use synonyms at query time
  426. <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  427. -->
  428. <!-- Case insensitive stop word removal.
  429. add enablePositionIncrements=true in both the index and query
  430. analyzers to leave a 'gap' for more accurate phrase queries.
  431. -->
  432. <filter class="solr.StopFilterFactory"
  433. ignoreCase="true"
  434. words="lang/stopwords_en.txt"
  435. enablePositionIncrements="true"
  436. />
  437. <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
  438. <filter class="solr.LowerCaseFilterFactory"/>
  439. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  440. <filter class="solr.PorterStemFilterFactory"/>
  441. </analyzer>
  442. <analyzer type="query">
  443. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  444. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  445. <filter class="solr.StopFilterFactory"
  446. ignoreCase="true"
  447. words="lang/stopwords_en.txt"
  448. enablePositionIncrements="true"
  449. />
  450. <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
  451. <filter class="solr.LowerCaseFilterFactory"/>
  452. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  453. <filter class="solr.PorterStemFilterFactory"/>
  454. </analyzer>
  455. </fieldType>
  456.  
  457. <!-- Less flexible matching, but less false matches. Probably not ideal for product names,
  458. but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
  459. <fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
  460. <analyzer>
  461. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  462. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
  463. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt"/>
  464. <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
  465. <filter class="solr.LowerCaseFilterFactory"/>
  466. <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  467. <filter class="solr.EnglishMinimalStemFilterFactory"/>
  468. <!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
  469. possible with WordDelimiterFilter in conjuncton with stemming. -->
  470. <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
  471. </analyzer>
  472. </fieldType>
  473.  
  474. <!-- Just like text_general except it reverses the characters of
  475. each token, to enable more efficient leading wildcard queries. -->
  476. <fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
  477. <analyzer type="index">
  478. <tokenizer class="solr.StandardTokenizerFactory"/>
  479. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
  480. <filter class="solr.LowerCaseFilterFactory"/>
  481. <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
  482. maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
  483. </analyzer>
  484. <analyzer type="query">
  485. <tokenizer class="solr.StandardTokenizerFactory"/>
  486. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  487. <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
  488. <filter class="solr.LowerCaseFilterFactory"/>
  489. </analyzer>
  490. </fieldType>
  491.  
  492. <!-- charFilter + WhitespaceTokenizer -->
  493. <!--
  494. <fieldType name="text_char_norm" class="solr.TextField" positionIncrementGap="100" >
  495. <analyzer>
  496. <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
  497. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  498. </analyzer>
  499. </fieldType>
  500. -->
  501.  
  502. <!-- This is an example of using the KeywordTokenizer along
  503. With various TokenFilterFactories to produce a sortable field
  504. that does not include some properties of the source text
  505. -->
  506. <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
  507. <analyzer>
  508. <!-- KeywordTokenizer does no actual tokenizing, so the entire
  509. input string is preserved as a single token
  510. -->
  511. <tokenizer class="solr.KeywordTokenizerFactory"/>
  512. <!-- The LowerCase TokenFilter does what you expect, which can be
  513. when you want your sorting to be case insensitive
  514. -->
  515. <filter class="solr.LowerCaseFilterFactory" />
  516. <!-- The TrimFilter removes any leading or trailing whitespace -->
  517. <filter class="solr.TrimFilterFactory" />
  518. <!-- The PatternReplaceFilter gives you the flexibility to use
  519. Java Regular expression to replace any sequence of characters
  520. matching a pattern with an arbitrary replacement string,
  521. which may include back references to portions of the original
  522. string matched by the pattern.
  523.  
  524. See the Java Regular Expression documentation for more
  525. information on pattern and replacement string syntax.
  526.  
  527. http://java.sun.com/j2se/1.6.0/docs/api/java/util/regex/package-summary.html
  528. -->
  529. <filter class="solr.PatternReplaceFilterFactory"
  530. pattern="([^a-z])" replacement="" replace="all"
  531. />
  532. </analyzer>
  533. </fieldType>
  534.  
  535. <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
  536. <analyzer>
  537. <tokenizer class="solr.StandardTokenizerFactory"/>
  538. <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
  539. </analyzer>
  540. </fieldtype>
  541.  
  542. <fieldtype name="payloads" stored="false" indexed="true" class="solr.TextField" >
  543. <analyzer>
  544. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  545. <!--
  546. The DelimitedPayloadTokenFilter can put payloads on tokens... for example,
  547. a token of "foo|1.4" would be indexed as "foo" with a payload of 1.4f
  548. Attributes of the DelimitedPayloadTokenFilterFactory :
  549. "delimiter" - a one character delimiter. Default is | (pipe)
  550. "encoder" - how to encode the following value into a playload
  551. float -> org.apache.lucene.analysis.payloads.FloatEncoder,
  552. integer -> o.a.l.a.p.IntegerEncoder
  553. identity -> o.a.l.a.p.IdentityEncoder
  554. Fully Qualified class name implementing PayloadEncoder, Encoder must have a no arg constructor.
  555. -->
  556. <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
  557. </analyzer>
  558. </fieldtype>
  559.  
  560. <!-- lowercases the entire field value, keeping it as a single token. -->
  561. <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
  562. <analyzer>
  563. <tokenizer class="solr.KeywordTokenizerFactory"/>
  564. <filter class="solr.LowerCaseFilterFactory" />
  565. </analyzer>
  566. </fieldType>
  567.  
  568. <!--
  569. Example of using PathHierarchyTokenizerFactory at index time, so
  570. queries for paths match documents at that path, or in descendent paths
  571. -->
  572. <fieldType name="descendent_path" class="solr.TextField">
  573. <analyzer type="index">
  574. <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
  575. </analyzer>
  576. <analyzer type="query">
  577. <tokenizer class="solr.KeywordTokenizerFactory" />
  578. </analyzer>
  579. </fieldType>
  580. <!--
  581. Example of using PathHierarchyTokenizerFactory at query time, so
  582. queries for paths match documents at that path, or in ancestor paths
  583. -->
  584. <fieldType name="ancestor_path" class="solr.TextField">
  585. <analyzer type="index">
  586. <tokenizer class="solr.KeywordTokenizerFactory" />
  587. </analyzer>
  588. <analyzer type="query">
  589. <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
  590. </analyzer>
  591. </fieldType>
  592.  
  593. <!-- since fields of this type are by default not stored or indexed,
  594. any data added to them will be ignored outright. -->
  595. <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
  596.  
  597. <!-- This point type indexes the coordinates as separate fields (subFields)
  598. If subFieldType is defined, it references a type, and a dynamic field
  599. definition is created matching *___<typename>. Alternately, if
  600. subFieldSuffix is defined, that is used to create the subFields.
  601. Example: if subFieldType="double", then the coordinates would be
  602. indexed in fields myloc_0___double,myloc_1___double.
  603. Example: if subFieldSuffix="_d" then the coordinates would be indexed
  604. in fields myloc_0_d,myloc_1_d
  605. The subFields are an implementation detail of the fieldType, and end
  606. users normally should not need to know about them.
  607. -->
  608. <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
  609.  
  610. <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
  611. <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
  612.  
  613. <!-- from solr3
  614. A Geohash is a compact representation of a latitude longitude pair in a single field.
  615. See http://wiki.apache.org/solr/SpatialSearch
  616. -->
  617. <fieldtype name="geohash" class="solr.GeoHashField"/>
  618.  
  619.  
  620. <!-- An alternative geospatial field type new to Solr 4. It supports multiValued and polygon shapes.
  621. For more information about this and other Spatial fields new to Solr 4, see:
  622. http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
  623. -->
  624. <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
  625. geo="true" distErrPct="0.025" maxDistErr="0.000009" units="degrees" />
  626.  
  627. <!-- Money/currency field type. See http://wiki.apache.org/solr/MoneyFieldType
  628. Parameters:
  629. defaultCurrency: Specifies the default currency if none specified. Defaults to "USD"
  630. precisionStep: Specifies the precisionStep for the TrieLong field used for the amount
  631. providerClass: Lets you plug in other exchange provider backend:
  632. solr.FileExchangeRateProvider is the default and takes one parameter:
  633. currencyConfig: name of an xml file holding exchange rates
  634. solr.OpenExchangeRatesOrgProvider uses rates from openexchangerates.org:
  635. ratesFileLocation: URL or path to rates JSON file (default latest.json on the web)
  636. refreshInterval: Number of minutes between each rates fetch (default: 1440, min: 60)
  637. -->
  638. <fieldType name="currency" class="solr.CurrencyField" precisionStep="8" defaultCurrency="USD" currencyConfig="currency.xml" />
  639.  
  640.  
  641.  
  642. <!-- some examples for different languages (generally ordered by ISO code) -->
  643.  
  644. <!-- Arabic -->
  645. <fieldType name="text_ar" class="solr.TextField" positionIncrementGap="100">
  646. <analyzer>
  647. <tokenizer class="solr.StandardTokenizerFactory"/>
  648. <!-- for any non-arabic -->
  649. <filter class="solr.LowerCaseFilterFactory"/>
  650. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ar.txt" enablePositionIncrements="true"/>
  651. <!-- normalizes ﻯ to ﻱ, etc -->
  652. <filter class="solr.ArabicNormalizationFilterFactory"/>
  653. <filter class="solr.ArabicStemFilterFactory"/>
  654. </analyzer>
  655. </fieldType>
  656.  
  657. <!-- Bulgarian -->
  658. <fieldType name="text_bg" class="solr.TextField" positionIncrementGap="100">
  659. <analyzer>
  660. <tokenizer class="solr.StandardTokenizerFactory"/>
  661. <filter class="solr.LowerCaseFilterFactory"/>
  662. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_bg.txt" enablePositionIncrements="true"/>
  663. <filter class="solr.BulgarianStemFilterFactory"/>
  664. </analyzer>
  665. </fieldType>
  666.  
  667. <!-- Catalan -->
  668. <fieldType name="text_ca" class="solr.TextField" positionIncrementGap="100">
  669. <analyzer>
  670. <tokenizer class="solr.StandardTokenizerFactory"/>
  671. <!-- removes l', etc -->
  672. <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ca.txt"/>
  673. <filter class="solr.LowerCaseFilterFactory"/>
  674. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ca.txt" enablePositionIncrements="true"/>
  675. <filter class="solr.SnowballPorterFilterFactory" language="Catalan"/>
  676. </analyzer>
  677. </fieldType>
  678.  
  679. <!-- CJK bigram (see text_ja for a Japanese configuration using morphological analysis) -->
  680. <fieldType name="text_cjk" class="solr.TextField" positionIncrementGap="100">
  681. <analyzer>
  682. <tokenizer class="solr.StandardTokenizerFactory"/>
  683. <!-- normalize width before bigram, as e.g. half-width dakuten combine -->
  684. <filter class="solr.CJKWidthFilterFactory"/>
  685. <!-- for any non-CJK -->
  686. <filter class="solr.LowerCaseFilterFactory"/>
  687. <filter class="solr.CJKBigramFilterFactory"/>
  688. </analyzer>
  689. </fieldType>
  690.  
  691. <!-- Czech -->
  692. <fieldType name="text_cz" class="solr.TextField" positionIncrementGap="100">
  693. <analyzer>
  694. <tokenizer class="solr.StandardTokenizerFactory"/>
  695. <filter class="solr.LowerCaseFilterFactory"/>
  696. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_cz.txt" enablePositionIncrements="true"/>
  697. <filter class="solr.CzechStemFilterFactory"/>
  698. </analyzer>
  699. </fieldType>
  700.  
  701. <!-- Danish -->
  702. <fieldType name="text_da" class="solr.TextField" positionIncrementGap="100">
  703. <analyzer>
  704. <tokenizer class="solr.StandardTokenizerFactory"/>
  705. <filter class="solr.LowerCaseFilterFactory"/>
  706. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_da.txt" format="snowball" enablePositionIncrements="true"/>
  707. <filter class="solr.SnowballPorterFilterFactory" language="Danish"/>
  708. </analyzer>
  709. </fieldType>
  710.  
  711. <!-- German -->
  712. <fieldType name="text_de" class="solr.TextField" positionIncrementGap="100">
  713. <analyzer>
  714. <tokenizer class="solr.StandardTokenizerFactory"/>
  715. <filter class="solr.LowerCaseFilterFactory"/>
  716. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_de.txt" format="snowball" enablePositionIncrements="true"/>
  717. <filter class="solr.GermanNormalizationFilterFactory"/>
  718. <filter class="solr.GermanLightStemFilterFactory"/>
  719. <!-- less aggressive: <filter class="solr.GermanMinimalStemFilterFactory"/> -->
  720. <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="German2"/> -->
  721. </analyzer>
  722. </fieldType>
  723.  
  724. <!-- Greek -->
  725. <fieldType name="text_el" class="solr.TextField" positionIncrementGap="100">
  726. <analyzer>
  727. <tokenizer class="solr.StandardTokenizerFactory"/>
  728. <!-- greek specific lowercase for sigma -->
  729. <filter class="solr.GreekLowerCaseFilterFactory"/>
  730. <filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_el.txt" enablePositionIncrements="true"/>
  731. <filter class="solr.GreekStemFilterFactory"/>
  732. </analyzer>
  733. </fieldType>
  734.  
  735. <!-- Spanish -->
  736. <fieldType name="text_es" class="solr.TextField" positionIncrementGap="100">
  737. <analyzer>
  738. <tokenizer class="solr.StandardTokenizerFactory"/>
  739. <filter class="solr.LowerCaseFilterFactory"/>
  740. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_es.txt" format="snowball" enablePositionIncrements="true"/>
  741. <filter class="solr.SpanishLightStemFilterFactory"/>
  742. <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Spanish"/> -->
  743. </analyzer>
  744. </fieldType>
  745.  
  746. <!-- Basque -->
  747. <fieldType name="text_eu" class="solr.TextField" positionIncrementGap="100">
  748. <analyzer>
  749. <tokenizer class="solr.StandardTokenizerFactory"/>
  750. <filter class="solr.LowerCaseFilterFactory"/>
  751. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_eu.txt" enablePositionIncrements="true"/>
  752. <filter class="solr.SnowballPorterFilterFactory" language="Basque"/>
  753. </analyzer>
  754. </fieldType>
  755.  
  756. <!-- Persian -->
  757. <fieldType name="text_fa" class="solr.TextField" positionIncrementGap="100">
  758. <analyzer>
  759. <!-- for ZWNJ -->
  760. <charFilter class="solr.PersianCharFilterFactory"/>
  761. <tokenizer class="solr.StandardTokenizerFactory"/>
  762. <filter class="solr.LowerCaseFilterFactory"/>
  763. <filter class="solr.ArabicNormalizationFilterFactory"/>
  764. <filter class="solr.PersianNormalizationFilterFactory"/>
  765. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fa.txt" enablePositionIncrements="true"/>
  766. </analyzer>
  767. </fieldType>
  768.  
  769. <!-- Finnish -->
  770. <fieldType name="text_fi" class="solr.TextField" positionIncrementGap="100">
  771. <analyzer>
  772. <tokenizer class="solr.StandardTokenizerFactory"/>
  773. <filter class="solr.LowerCaseFilterFactory"/>
  774. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fi.txt" format="snowball" enablePositionIncrements="true"/>
  775. <filter class="solr.SnowballPorterFilterFactory" language="Finnish"/>
  776. <!-- less aggressive: <filter class="solr.FinnishLightStemFilterFactory"/> -->
  777. </analyzer>
  778. </fieldType>
  779.  
  780. <!-- French -->
  781. <fieldType name="text_fr" class="solr.TextField" positionIncrementGap="100">
  782. <analyzer>
  783. <tokenizer class="solr.StandardTokenizerFactory"/>
  784. <!-- removes l', etc -->
  785. <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_fr.txt"/>
  786. <filter class="solr.LowerCaseFilterFactory"/>
  787. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fr.txt" format="snowball" enablePositionIncrements="true"/>
  788. <filter class="solr.FrenchLightStemFilterFactory"/>
  789. <!-- less aggressive: <filter class="solr.FrenchMinimalStemFilterFactory"/> -->
  790. <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="French"/> -->
  791. </analyzer>
  792. </fieldType>
  793.  
  794. <!-- Irish -->
  795. <fieldType name="text_ga" class="solr.TextField" positionIncrementGap="100">
  796. <analyzer>
  797. <tokenizer class="solr.StandardTokenizerFactory"/>
  798. <!-- removes d', etc -->
  799. <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ga.txt"/>
  800. <!-- removes n-, etc. position increments is intentionally false! -->
  801. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/hyphenations_ga.txt" enablePositionIncrements="false"/>
  802. <filter class="solr.IrishLowerCaseFilterFactory"/>
  803. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ga.txt" enablePositionIncrements="true"/>
  804. <filter class="solr.SnowballPorterFilterFactory" language="Irish"/>
  805. </analyzer>
  806. </fieldType>
  807.  
  808. <!-- Galician -->
  809. <fieldType name="text_gl" class="solr.TextField" positionIncrementGap="100">
  810. <analyzer>
  811. <tokenizer class="solr.StandardTokenizerFactory"/>
  812. <filter class="solr.LowerCaseFilterFactory"/>
  813. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_gl.txt" enablePositionIncrements="true"/>
  814. <filter class="solr.GalicianStemFilterFactory"/>
  815. <!-- less aggressive: <filter class="solr.GalicianMinimalStemFilterFactory"/> -->
  816. </analyzer>
  817. </fieldType>
  818.  
  819. <!-- Hindi -->
  820. <fieldType name="text_hi" class="solr.TextField" positionIncrementGap="100">
  821. <analyzer>
  822. <tokenizer class="solr.StandardTokenizerFactory"/>
  823. <filter class="solr.LowerCaseFilterFactory"/>
  824. <!-- normalizes unicode representation -->
  825. <filter class="solr.IndicNormalizationFilterFactory"/>
  826. <!-- normalizes variation in spelling -->
  827. <filter class="solr.HindiNormalizationFilterFactory"/>
  828. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hi.txt" enablePositionIncrements="true"/>
  829. <filter class="solr.HindiStemFilterFactory"/>
  830. </analyzer>
  831. </fieldType>
  832.  
  833. <!-- Hungarian -->
  834. <fieldType name="text_hu" class="solr.TextField" positionIncrementGap="100">
  835. <analyzer>
  836. <tokenizer class="solr.StandardTokenizerFactory"/>
  837. <filter class="solr.LowerCaseFilterFactory"/>
  838. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hu.txt" format="snowball" enablePositionIncrements="true"/>
  839. <filter class="solr.SnowballPorterFilterFactory" language="Hungarian"/>
  840. <!-- less aggressive: <filter class="solr.HungarianLightStemFilterFactory"/> -->
  841. </analyzer>
  842. </fieldType>
  843.  
  844. <!-- Armenian -->
  845. <fieldType name="text_hy" class="solr.TextField" positionIncrementGap="100">
  846. <analyzer>
  847. <tokenizer class="solr.StandardTokenizerFactory"/>
  848. <filter class="solr.LowerCaseFilterFactory"/>
  849. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hy.txt" enablePositionIncrements="true"/>
  850. <filter class="solr.SnowballPorterFilterFactory" language="Armenian"/>
  851. </analyzer>
  852. </fieldType>
  853.  
  854. <!-- Indonesian -->
  855. <fieldType name="text_id" class="solr.TextField" positionIncrementGap="100">
  856. <analyzer>
  857. <tokenizer class="solr.StandardTokenizerFactory"/>
  858. <filter class="solr.LowerCaseFilterFactory"/>
  859. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_id.txt" enablePositionIncrements="true"/>
  860. <!-- for a less aggressive approach (only inflectional suffixes), set stemDerivational to false -->
  861. <filter class="solr.IndonesianStemFilterFactory" stemDerivational="true"/>
  862. </analyzer>
  863. </fieldType>
  864.  
  865. <!-- Italian -->
  866. <fieldType name="text_it" class="solr.TextField" positionIncrementGap="100">
  867. <analyzer>
  868. <tokenizer class="solr.StandardTokenizerFactory"/>
  869. <!-- removes l', etc -->
  870. <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_it.txt"/>
  871. <filter class="solr.LowerCaseFilterFactory"/>
  872. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_it.txt" format="snowball" enablePositionIncrements="true"/>
  873. <filter class="solr.ItalianLightStemFilterFactory"/>
  874. <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Italian"/> -->
  875. </analyzer>
  876. </fieldType>
  877.  
  878. <!-- Japanese using morphological analysis (see text_cjk for a configuration using bigramming)
  879.  
  880. NOTE: If you want to optimize search for precision, use default operator AND in your query
  881. parser config with <solrQueryParser defaultOperator="AND"/> further down in this file. Use
  882. OR if you would like to optimize for recall (default).
  883. -->
  884. <fieldType name="text_ja" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="false">
  885. <analyzer>
  886. <!-- Kuromoji Japanese morphological analyzer/tokenizer (JapaneseTokenizer)
  887.  
  888. Kuromoji has a search mode (default) that does segmentation useful for search. A heuristic
  889. is used to segment compounds into its parts and the compound itself is kept as synonym.
  890.  
  891. Valid values for attribute mode are:
  892. normal: regular segmentation
  893. search: segmentation useful for search with synonyms compounds (default)
  894. extended: same as search mode, but unigrams unknown words (experimental)
  895.  
  896. For some applications it might be good to use search mode for indexing and normal mode for
  897. queries to reduce recall and prevent parts of compounds from being matched and highlighted.
  898. Use <analyzer type="index"> and <analyzer type="query"> for this and mode normal in query.
  899.  
  900. Kuromoji also has a convenient user dictionary feature that allows overriding the statistical
  901. model with your own entries for segmentation, part-of-speech tags and readings without a need
  902. to specify weights. Notice that user dictionaries have not been subject to extensive testing.
  903.  
  904. User dictionary attributes are:
  905. userDictionary: user dictionary filename
  906. userDictionaryEncoding: user dictionary encoding (default is UTF-8)
  907.  
  908. See lang/userdict_ja.txt for a sample user dictionary file.
  909.  
  910. Punctuation characters are discarded by default. Use discardPunctuation="false" to keep them.
  911.  
  912. See http://wiki.apache.org/solr/JapaneseLanguageSupport for more on Japanese language support.
  913. -->
  914. <tokenizer class="solr.JapaneseTokenizerFactory" mode="search"/>
  915. <!--<tokenizer class="solr.JapaneseTokenizerFactory" mode="search" userDictionary="lang/userdict_ja.txt"/>-->
  916. <!-- Reduces inflected verbs and adjectives to their base/dictionary forms (辞書形) -->
  917. <filter class="solr.JapaneseBaseFormFilterFactory"/>
  918. <!-- Removes tokens with certain part-of-speech tags -->
  919. <filter class="solr.JapanesePartOfSpeechStopFilterFactory" tags="lang/stoptags_ja.txt" enablePositionIncrements="true"/>
  920. <!-- Normalizes full-width romaji to half-width and half-width kana to full-width (Unicode NFKC subset) -->
  921. <filter class="solr.CJKWidthFilterFactory"/>
  922. <!-- Removes common tokens typically not useful for search, but have a negative effect on ranking -->
  923. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ja.txt" enablePositionIncrements="true" />
  924. <!-- Normalizes common katakana spelling variations by removing any last long sound character (U+30FC) -->
  925. <filter class="solr.JapaneseKatakanaStemFilterFactory" minimumLength="4"/>
  926. <!-- Lower-cases romaji characters -->
  927. <filter class="solr.LowerCaseFilterFactory"/>
  928. </analyzer>
  929. </fieldType>
  930.  
  931. <!-- Latvian -->
  932. <fieldType name="text_lv" class="solr.TextField" positionIncrementGap="100">
  933. <analyzer>
  934. <tokenizer class="solr.StandardTokenizerFactory"/>
  935. <filter class="solr.LowerCaseFilterFactory"/>
  936. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_lv.txt" enablePositionIncrements="true"/>
  937. <filter class="solr.LatvianStemFilterFactory"/>
  938. </analyzer>
  939. </fieldType>
  940.  
  941. <!-- Dutch -->
  942. <fieldType name="text_nl" class="solr.TextField" positionIncrementGap="100">
  943. <analyzer>
  944. <tokenizer class="solr.StandardTokenizerFactory"/>
  945. <filter class="solr.LowerCaseFilterFactory"/>
  946. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_nl.txt" format="snowball" enablePositionIncrements="true"/>
  947. <filter class="solr.StemmerOverrideFilterFactory" dictionary="lang/stemdict_nl.txt" ignoreCase="false"/>
  948. <filter class="solr.SnowballPorterFilterFactory" language="Dutch"/>
  949. </analyzer>
  950. </fieldType>
  951.  
  952. <!-- Norwegian -->
  953. <fieldType name="text_no" class="solr.TextField" positionIncrementGap="100">
  954. <analyzer>
  955. <tokenizer class="solr.StandardTokenizerFactory"/>
  956. <filter class="solr.LowerCaseFilterFactory"/>
  957. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_no.txt" format="snowball" enablePositionIncrements="true"/>
  958. <filter class="solr.SnowballPorterFilterFactory" language="Norwegian"/>
  959. <!-- less aggressive: <filter class="solr.NorwegianLightStemFilterFactory"/> -->
  960. <!-- singular/plural: <filter class="solr.NorwegianMinimalStemFilterFactory"/> -->
  961. </analyzer>
  962. </fieldType>
  963.  
  964. <!-- Portuguese -->
  965. <fieldType name="text_pt" class="solr.TextField" positionIncrementGap="100">
  966. <analyzer>
  967. <tokenizer class="solr.StandardTokenizerFactory"/>
  968. <filter class="solr.LowerCaseFilterFactory"/>
  969. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pt.txt" format="snowball" enablePositionIncrements="true"/>
  970. <filter class="solr.PortugueseLightStemFilterFactory"/>
  971. <!-- less aggressive: <filter class="solr.PortugueseMinimalStemFilterFactory"/> -->
  972. <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Portuguese"/> -->
  973. <!-- most aggressive: <filter class="solr.PortugueseStemFilterFactory"/> -->
  974. </analyzer>
  975. </fieldType>
  976.  
  977. <!-- Romanian -->
  978. <fieldType name="text_ro" class="solr.TextField" positionIncrementGap="100">
  979. <analyzer>
  980. <tokenizer class="solr.StandardTokenizerFactory"/>
  981. <filter class="solr.LowerCaseFilterFactory"/>
  982. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ro.txt" enablePositionIncrements="true"/>
  983. <filter class="solr.SnowballPorterFilterFactory" language="Romanian"/>
  984. </analyzer>
  985. </fieldType>
  986.  
  987. <!-- Russian -->
  988. <fieldType name="text_ru" class="solr.TextField" positionIncrementGap="100">
  989. <analyzer>
  990. <tokenizer class="solr.StandardTokenizerFactory"/>
  991. <filter class="solr.LowerCaseFilterFactory"/>
  992. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ru.txt" format="snowball" enablePositionIncrements="true"/>
  993. <filter class="solr.SnowballPorterFilterFactory" language="Russian"/>
  994. <!-- less aggressive: <filter class="solr.RussianLightStemFilterFactory"/> -->
  995. </analyzer>
  996. </fieldType>
  997.  
  998. <!-- Swedish -->
  999. <fieldType name="text_sv" class="solr.TextField" positionIncrementGap="100">
  1000. <analyzer>
  1001. <tokenizer class="solr.StandardTokenizerFactory"/>
  1002. <filter class="solr.LowerCaseFilterFactory"/>
  1003. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_sv.txt" format="snowball" enablePositionIncrements="true"/>
  1004. <filter class="solr.SnowballPorterFilterFactory" language="Swedish"/>
  1005. <!-- less aggressive: <filter class="solr.SwedishLightStemFilterFactory"/> -->
  1006. </analyzer>
  1007. </fieldType>
  1008.  
  1009. <!-- Thai -->
  1010. <fieldType name="text_th" class="solr.TextField" positionIncrementGap="100">
  1011. <analyzer>
  1012. <tokenizer class="solr.StandardTokenizerFactory"/>
  1013. <filter class="solr.LowerCaseFilterFactory"/>
  1014. <filter class="solr.ThaiWordFilterFactory"/>
  1015. <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_th.txt" enablePositionIncrements="true"/>
  1016. </analyzer>
  1017. </fieldType>
  1018.  
  1019. <!-- Turkish -->
  1020. <fieldType name="text_tr" class="solr.TextField" positionIncrementGap="100">
  1021. <analyzer>
  1022. <tokenizer class="solr.StandardTokenizerFactory"/>
  1023. <filter class="solr.TurkishLowerCaseFilterFactory"/>
  1024. <filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_tr.txt" enablePositionIncrements="true"/>
  1025. <filter class="solr.SnowballPorterFilterFactory" language="Turkish"/>
  1026. </analyzer>
  1027. </fieldType>
  1028.  
  1029. <fieldType name="text_stx" class="solr.TextField" positionIncrementGap="100">
  1030. <analyzer type="index">
  1031. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  1032. <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/>
  1033. <filter class="solr.LowerCaseFilterFactory"/>
  1034. <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
  1035. maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
  1036. </analyzer>
  1037. <analyzer type="query">
  1038. <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  1039. <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  1040. <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
  1041. <filter class="solr.LowerCaseFilterFactory"/>
  1042. </analyzer>
  1043. </fieldType>
  1044.  
  1045. <!--nmg-->
  1046. <!--links:
  1047. http://wiki.apache.org/solr/SpatialSearchDev
  1048. http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
  1049. http://wiki.apache.org/solr/SpatialForTimeDurations
  1050.  
  1051. Index (Multiple) Durrations As (Multiple) Points
  1052. X = "Start" // startDate
  1053. Y = "End" // endDate
  1054. Query Using Rectangles Defined in Various Ways
  1055. Document Durration Contains Query Durration
  1056. q=fieldX:"Intersects(-8 end start 8)"
  1057. Document Durration Overlaps Query Durration
  1058. q=fieldX:"Intersects(-8 start end 8)"
  1059. Document Durration Within Query Durration
  1060. q=fieldX:"Intersects(start -8 8 end)"
  1061. -->
  1062. <!-- worldBounds="0 0 30000000 30000000" : Xmin, Ymin, Xmax, Ymax : in our case we convert date to int YYYYMMDD -->
  1063. <fieldType name="time_range_stx" class="solr.SpatialRecursivePrefixTreeFieldType" geo="false" worldBounds="-300000000 -300000000 300000000 300000000"
  1064. distErrPct="0"
  1065. maxDistErr="1"
  1066. units="degrees"/>
  1067.  
  1068. </types>
  1069.  
  1070. <!-- Similarity is the scoring routine for each document vs. a query.
  1071. A custom Similarity or SimilarityFactory may be specified here, but
  1072. the default is fine for most applications.
  1073. For more info: http://wiki.apache.org/solr/SchemaXml#Similarity
  1074. -->
  1075. <!--
  1076. <similarity class="com.example.solr.CustomSimilarityFactory">
  1077. <str name="paramkey">param value</str>
  1078. </similarity>
  1079. -->
  1080.  
  1081. </schema>
Add Comment
Please, Sign In to add comment