Guest User

schema.xml

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