kkiran

Untitled

Jul 27th, 2011
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 30.18 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2.  
  3. <!--
  4.  
  5. Licensed to the Apache Software Foundation (ASF) under one or more
  6.  
  7. contributor license agreements.  See the NOTICE file distributed with
  8.  
  9. this work for additional information regarding copyright ownership.
  10.  
  11. The ASF licenses this file to You under the Apache License, Version 2.0
  12.  
  13. (the "License"); you may not use this file except in compliance with
  14.  
  15. the License.  You may obtain a copy of the License at
  16.  
  17.  
  18.  
  19.     http://www.apache.org/licenses/LICENSE-2.0
  20.  
  21.  
  22.  
  23. Unless required by applicable law or agreed to in writing, software
  24.  
  25. distributed under the License is distributed on an "AS IS" BASIS,
  26.  
  27. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  28.  
  29. See the License for the specific language governing permissions and
  30.  
  31. limitations under the License.
  32.  
  33. -->
  34.  
  35.  
  36.  
  37. <!--  
  38.  
  39. This is the Solr schema file. This file should be named "schema.xml" and
  40.  
  41. should be in the conf directory under the solr home
  42.  
  43. (i.e. ./solr/conf/schema.xml by default)
  44.  
  45. or located where the classloader for the Solr webapp can find it.
  46.  
  47.  
  48.  
  49. This example schema is the recommended starting point for users.
  50.  
  51. It should be kept correct and concise, usable out-of-the-box.
  52.  
  53.  
  54.  
  55. For more information, on how to customize this file, please see
  56.  
  57. http://wiki.apache.org/solr/SchemaXml
  58.  
  59.  
  60.  
  61. PERFORMANCE NOTE: this schema includes many optional features and should not
  62.  
  63. be used for benchmarking.  To improve performance one could
  64.  
  65.  - set stored="false" for all fields possible (esp large fields) when you
  66.  
  67.    only need to search on the field but don't need to return the original
  68.  
  69.    value.
  70.  
  71.  - set indexed="false" if you don't need to search on the field, but only
  72.  
  73.    return the field as a result of searching on other indexed fields.
  74.  
  75.  - remove all unneeded copyField statements
  76.  
  77.  - for best index size and searching performance, set "index" to false
  78.  
  79.    for all general text fields, use copyField to copy them to the
  80.  
  81.    catchall "text" field, and use that for searching.
  82.  
  83.  - For maximum indexing performance, use the StreamingUpdateSolrServer
  84.  
  85.    java client.
  86.  
  87.  - Remember to run the JVM in server mode, and use a higher logging level
  88.  
  89.    that avoids logging every request
  90.  
  91. -->
  92.  
  93.  
  94.  
  95. <schema name="example" version="1.4">
  96.  
  97.   <!-- attribute "name" is the name of this schema and is only used for display purposes.
  98.  
  99.       Applications should change this to reflect the nature of the search collection.
  100.  
  101.       version="1.4" is Solr's version number for the schema syntax and semantics.  It should
  102.  
  103.       not normally be changed by applications.
  104.  
  105.       1.0: multiValued attribute did not exist, all fields are multiValued by nature
  106.  
  107.       1.1: multiValued attribute introduced, false by default
  108.  
  109.       1.2: omitTermFreqAndPositions attribute introduced, true by default except for text fields.
  110.  
  111.       1.3: removed optional field compress feature
  112.  
  113.       1.4: default auto-phrase (QueryParser feature) to off
  114.  
  115.     -->
  116.  
  117.  
  118.  
  119.   <types>
  120.  
  121.     <!-- field type definitions. The "name" attribute is
  122.  
  123.       just a label to be used by field definitions.  The "class"
  124.  
  125.       attribute and any other attributes determine the real
  126.  
  127.       behavior of the fieldType.
  128.  
  129.         Class names starting with "solr" refer to java classes in the
  130.  
  131.       org.apache.solr.analysis package.
  132.  
  133.    -->
  134.  
  135.  
  136.  
  137.     <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
  138.  
  139.     <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
  140.  
  141.  
  142.  
  143.     <!-- boolean type: "true" or "false" -->
  144.  
  145.     <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
  146.  
  147.     <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
  148.  
  149.     <fieldtype name="binary" class="solr.BinaryField"/>
  150.  
  151.  
  152.  
  153.     <!-- The optional sortMissingLast and sortMissingFirst attributes are
  154.  
  155.         currently supported on types that are sorted internally as strings.
  156.  
  157.            This includes "string","boolean","sint","slong","sfloat","sdouble","pdate"
  158.  
  159.       - If sortMissingLast="true", then a sort on this field will cause documents
  160.  
  161.         without the field to come after documents with the field,
  162.  
  163.         regardless of the requested sort order (asc or desc).
  164.  
  165.       - If sortMissingFirst="true", then a sort on this field will cause documents
  166.  
  167.         without the field to come before documents with the field,
  168.  
  169.         regardless of the requested sort order.
  170.  
  171.       - If sortMissingLast="false" and sortMissingFirst="false" (the default),
  172.  
  173.         then default lucene sorting will be used which places docs without the
  174.  
  175.         field first in an ascending sort and last in a descending sort.
  176.  
  177.    -->    
  178.  
  179.  
  180.  
  181.     <!--
  182.  
  183.      Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
  184.  
  185.    -->
  186.  
  187.     <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
  188.  
  189.     <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
  190.  
  191.     <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
  192.  
  193.     <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
  194.  
  195.  
  196.  
  197.     <!--
  198.  
  199.     Numeric field types that index each value at various levels of precision
  200.  
  201.     to accelerate range queries when the number of values between the range
  202.  
  203.     endpoints is large. See the javadoc for NumericRangeQuery for internal
  204.  
  205.     implementation details.
  206.  
  207.  
  208.  
  209.     Smaller precisionStep values (specified in bits) will lead to more tokens
  210.  
  211.     indexed per value, slightly larger index size, and faster range queries.
  212.  
  213.     A precisionStep of 0 disables indexing at different precision levels.
  214.  
  215.    -->
  216.  
  217.     <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
  218.  
  219.     <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
  220.  
  221.     <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
  222.  
  223.     <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
  224.  
  225.  
  226.  
  227.     <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
  228.  
  229.         is a more restricted form of the canonical representation of dateTime
  230.  
  231.         http://www.w3.org/TR/xmlschema-2/#dateTime    
  232.  
  233.         The trailing "Z" designates UTC time and is mandatory.
  234.  
  235.         Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
  236.  
  237.         All other components are mandatory.
  238.  
  239.  
  240.  
  241.         Expressions can also be used to denote calculations that should be
  242.  
  243.         performed relative to "NOW" to determine the value, ie...
  244.  
  245.  
  246.  
  247.               NOW/HOUR
  248.  
  249.                  ... Round to the start of the current hour
  250.  
  251.               NOW-1DAY
  252.  
  253.                  ... Exactly 1 day prior to now
  254.  
  255.               NOW/DAY+6MONTHS+3DAYS
  256.  
  257.                  ... 6 months and 3 days in the future from the start of
  258.  
  259.                      the current day
  260.  
  261.                      
  262.  
  263.         Consult the DateField javadocs for more information.
  264.  
  265.  
  266.  
  267.         Note: For faster range queries, consider the tdate type
  268.  
  269.      -->
  270.  
  271.     <fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0"/>
  272.  
  273.  
  274.  
  275.     <!-- A Trie based date field for faster date range queries and date faceting. -->
  276.  
  277.     <fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
  278.  
  279.  
  280.  
  281.  
  282.  
  283.     <!--
  284.  
  285.      Note:
  286.  
  287.      These should only be used for compatibility with existing indexes (created with older Solr versions)
  288.  
  289.      or if "sortMissingFirst" or "sortMissingLast" functionality is needed. Use Trie based fields instead.
  290.  
  291.  
  292.  
  293.      Plain numeric field types that store and index the text
  294.  
  295.      value verbatim (and hence don't support range queries, since the
  296.  
  297.      lexicographic ordering isn't equal to the numeric ordering)
  298.  
  299.    -->
  300.  
  301.     <fieldType name="pint" class="solr.IntField" omitNorms="true"/>
  302.  
  303.     <fieldType name="plong" class="solr.LongField" omitNorms="true"/>
  304.  
  305.     <fieldType name="pfloat" class="solr.FloatField" omitNorms="true"/>
  306.  
  307.     <fieldType name="pdouble" class="solr.DoubleField" omitNorms="true"/>
  308.  
  309.     <fieldType name="pdate" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>
  310.  
  311.  
  312.  
  313.  
  314.  
  315.     <!--
  316.  
  317.      Note:
  318.  
  319.      These should only be used for compatibility with existing indexes (created with older Solr versions)
  320.  
  321.      or if "sortMissingFirst" or "sortMissingLast" functionality is needed. Use Trie based fields instead.
  322.  
  323.  
  324.  
  325.      Numeric field types that manipulate the value into
  326.  
  327.      a string value that isn't human-readable in its internal form,
  328.  
  329.      but with a lexicographic ordering the same as the numeric ordering,
  330.  
  331.      so that range queries work correctly.
  332.  
  333.    -->
  334.  
  335.     <fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
  336.  
  337.     <fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
  338.  
  339.     <fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
  340.  
  341.     <fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>
  342.  
  343.  
  344.  
  345.  
  346.  
  347.     <!-- The "RandomSortField" is not used to store or search any
  348.  
  349.         data.  You can declare fields of this type it in your schema
  350.  
  351.         to generate pseudo-random orderings of your docs for sorting
  352.  
  353.         purposes.  The ordering is generated based on the field name
  354.  
  355.         and the version of the index, As long as the index version
  356.  
  357.         remains unchanged, and the same field name is reused,
  358.  
  359.         the ordering of the docs will be consistent.  
  360.  
  361.         If you want different psuedo-random orderings of documents,
  362.  
  363.         for the same version of the index, use a dynamicField and
  364.  
  365.         change the name
  366.  
  367.     -->
  368.  
  369.     <fieldType name="random" class="solr.RandomSortField" indexed="true" />
  370.  
  371.  
  372.  
  373.     <!-- solr.TextField allows the specification of custom text analyzers
  374.  
  375.         specified as a tokenizer and a list of token filters. Different
  376.  
  377.         analyzers may be specified for indexing and querying.
  378.  
  379.  
  380.  
  381.         The optional positionIncrementGap puts space between multiple fields of
  382.  
  383.         this type on the same document, with the purpose of preventing false phrase
  384.  
  385.         matching across fields.
  386.  
  387.  
  388.  
  389.         For more info on customizing your analyzer chain, please see
  390.  
  391.         http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
  392.  
  393.     -->
  394.  
  395.  
  396.  
  397.     <!-- One can also specify an existing Analyzer class that has a
  398.  
  399.         default constructor via the class attribute on the analyzer element
  400.  
  401.    <fieldType name="text_greek" class="solr.TextField">
  402.  
  403.      <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
  404.  
  405.    </fieldType>
  406.  
  407.    -->
  408.  
  409.  
  410.  
  411.     <!-- A text field that only splits on whitespace for exact matching of words -->
  412.  
  413.     <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
  414.  
  415.       <analyzer>
  416.  
  417.         <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  418.  
  419.       </analyzer>
  420.  
  421.     </fieldType>
  422.  
  423.  
  424.  
  425.     <!-- A general text field that has reasonable, generic
  426.  
  427.         cross-language defaults: it tokenizes with StandardTokenizer,
  428.  
  429.      removes stop words from case-insensitive "stopwords.txt"
  430.  
  431.      (empty by default), and down cases.  At query time only, it
  432.  
  433.      also applies synonyms. -->
  434.  
  435.     <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
  436.  
  437.       <analyzer type="index">
  438.  
  439.         <tokenizer class="solr.StandardTokenizerFactory"/>
  440.  
  441.         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
  442.  
  443.         <!-- in this example, we will only use synonyms at query time
  444.  
  445.        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  446.  
  447.        -->
  448.  
  449.         <filter class="solr.LowerCaseFilterFactory"/>
  450.  
  451.       </analyzer>
  452.  
  453.       <analyzer type="query">
  454.  
  455.         <tokenizer class="solr.StandardTokenizerFactory"/>
  456.  
  457.         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
  458.  
  459.         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  460.  
  461.         <filter class="solr.LowerCaseFilterFactory"/>
  462.  
  463.       </analyzer>
  464.  
  465.     </fieldType>
  466.  
  467.  
  468.  
  469.     <!-- A text field with defaults appropriate for English: it
  470.  
  471.         tokenizes with StandardTokenizer, removes English stop words
  472.  
  473.         (stopwords_en.txt), down cases, protects words from protwords.txt, and
  474.  
  475.         finally applies Porter's stemming.  The query time analyzer
  476.  
  477.         also applies synonyms from synonyms.txt. -->
  478.  
  479.     <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
  480.  
  481.       <analyzer type="index">
  482.  
  483.         <tokenizer class="solr.StandardTokenizerFactory"/>
  484.  
  485.         <!-- in this example, we will only use synonyms at query time
  486.  
  487.        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  488.  
  489.        -->
  490.  
  491.         <!-- Case insensitive stop word removal.
  492.  
  493.          add enablePositionIncrements=true in both the index and query
  494.  
  495.          analyzers to leave a 'gap' for more accurate phrase queries.
  496.  
  497.        -->
  498.  
  499.         <filter class="solr.StopFilterFactory"
  500.  
  501.                ignoreCase="true"
  502.  
  503.                words="stopwords_en.txt"
  504.  
  505.                enablePositionIncrements="true"
  506.  
  507.                />
  508.  
  509.         <filter class="solr.LowerCaseFilterFactory"/>
  510.  
  511.     <filter class="solr.EnglishPossessiveFilterFactory"/>
  512.  
  513.         <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  514.  
  515.     <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
  516.  
  517.        <filter class="solr.EnglishMinimalStemFilterFactory"/>
  518.  
  519.     -->
  520.  
  521.         <filter class="solr.PorterStemFilterFactory"/>
  522.  
  523.       </analyzer>
  524.  
  525.       <analyzer type="query">
  526.  
  527.         <tokenizer class="solr.StandardTokenizerFactory"/>
  528.  
  529.         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  530.  
  531.         <filter class="solr.StopFilterFactory"
  532.  
  533.                ignoreCase="true"
  534.  
  535.                words="stopwords_en.txt"
  536.  
  537.                enablePositionIncrements="true"
  538.  
  539.                />
  540.  
  541.         <filter class="solr.LowerCaseFilterFactory"/>
  542.  
  543.     <filter class="solr.EnglishPossessiveFilterFactory"/>
  544.  
  545.         <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  546.  
  547.     <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
  548.  
  549.        <filter class="solr.EnglishMinimalStemFilterFactory"/>
  550.  
  551.     -->
  552.  
  553.         <filter class="solr.PorterStemFilterFactory"/>
  554.  
  555.       </analyzer>
  556.  
  557.     </fieldType>
  558.  
  559.  
  560.  
  561.     <!-- A text field with defaults appropriate for English, plus
  562.  
  563.      aggressive word-splitting and autophrase features enabled.
  564.  
  565.      This field is just like text_en, except it adds
  566.  
  567.      WordDelimiterFilter to enable splitting and matching of
  568.  
  569.      words on case-change, alpha numeric boundaries, and
  570.  
  571.      non-alphanumeric chars.  This means certain compound word
  572.  
  573.      cases will work, for example query "wi fi" will match
  574.  
  575.      document "WiFi" or "wi-fi".  However, other cases will still
  576.  
  577.      not match, for example if the query is "wifi" and the
  578.  
  579.      document is "wi fi" or if the query is "wi-fi" and the
  580.  
  581.      document is "wifi".
  582.  
  583.        -->
  584.  
  585.     <fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
  586.  
  587.       <analyzer type="index">
  588.  
  589.         <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  590.  
  591.         <!-- in this example, we will only use synonyms at query time
  592.  
  593.        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  594.  
  595.        -->
  596.  
  597.         <!-- Case insensitive stop word removal.
  598.  
  599.          add enablePositionIncrements=true in both the index and query
  600.  
  601.          analyzers to leave a 'gap' for more accurate phrase queries.
  602.  
  603.        -->
  604.  
  605.         <filter class="solr.StopFilterFactory"
  606.  
  607.                ignoreCase="true"
  608.  
  609.                words="stopwords_en.txt"
  610.  
  611.                enablePositionIncrements="true"
  612.  
  613.                />
  614.  
  615.         <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
  616.  
  617.         <filter class="solr.LowerCaseFilterFactory"/>
  618.  
  619.         <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  620.  
  621.         <filter class="solr.PorterStemFilterFactory"/>
  622.  
  623.       </analyzer>
  624.  
  625.       <analyzer type="query">
  626.  
  627.         <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  628.  
  629.         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  630.  
  631.         <filter class="solr.StopFilterFactory"
  632.  
  633.                ignoreCase="true"
  634.  
  635.                words="stopwords_en.txt"
  636.  
  637.                enablePositionIncrements="true"
  638.  
  639.                />
  640.  
  641.         <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
  642.  
  643.         <filter class="solr.LowerCaseFilterFactory"/>
  644.  
  645.         <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  646.  
  647.         <filter class="solr.PorterStemFilterFactory"/>
  648.  
  649.       </analyzer>
  650.  
  651.     </fieldType>
  652.  
  653.  
  654.  
  655.     <!-- Less flexible matching, but less false matches.  Probably not ideal for product names,
  656.  
  657.         but may be good for SKUs.  Can insert dashes in the wrong place and still match. -->
  658.  
  659.     <fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
  660.  
  661.       <analyzer>
  662.  
  663.         <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  664.  
  665.         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
  666.  
  667.         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt"/>
  668.  
  669.         <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
  670.  
  671.         <filter class="solr.LowerCaseFilterFactory"/>
  672.  
  673.         <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  674.  
  675.         <filter class="solr.EnglishMinimalStemFilterFactory"/>
  676.  
  677.         <!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
  678.  
  679.             possible with WordDelimiterFilter in conjuncton with stemming. -->
  680.  
  681.         <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
  682.  
  683.       </analyzer>
  684.  
  685.     </fieldType>
  686.  
  687.  
  688.  
  689.     <!-- Just like text_general except it reverses the characters of
  690.  
  691.      each token, to enable more efficient leading wildcard queries. -->
  692.  
  693.     <fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
  694.  
  695.       <analyzer type="index">
  696.  
  697.         <tokenizer class="solr.StandardTokenizerFactory"/>
  698.  
  699.         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
  700.  
  701.         <filter class="solr.LowerCaseFilterFactory"/>
  702.  
  703.         <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
  704.  
  705.           maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
  706.  
  707.       </analyzer>
  708.  
  709.       <analyzer type="query">
  710.  
  711.         <tokenizer class="solr.StandardTokenizerFactory"/>
  712.  
  713.         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  714.  
  715.         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
  716.  
  717.         <filter class="solr.LowerCaseFilterFactory"/>
  718.  
  719.       </analyzer>
  720.  
  721.     </fieldType>
  722.  
  723.  
  724.  
  725.     <!-- charFilter + WhitespaceTokenizer  -->
  726.  
  727.     <!--
  728.  
  729.    <fieldType name="text_char_norm" class="solr.TextField" positionIncrementGap="100" >
  730.  
  731.      <analyzer>
  732.  
  733.        <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
  734.  
  735.        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  736.  
  737.      </analyzer>
  738.  
  739.    </fieldType>
  740.  
  741.    -->
  742.  
  743.  
  744.  
  745.     <!-- This is an example of using the KeywordTokenizer along
  746.  
  747.         With various TokenFilterFactories to produce a sortable field
  748.  
  749.         that does not include some properties of the source text
  750.  
  751.      -->
  752.  
  753.     <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
  754.  
  755.       <analyzer>
  756.  
  757.         <!-- KeywordTokenizer does no actual tokenizing, so the entire
  758.  
  759.             input string is preserved as a single token
  760.  
  761.          -->
  762.  
  763.         <tokenizer class="solr.KeywordTokenizerFactory"/>
  764.  
  765.         <!-- The LowerCase TokenFilter does what you expect, which can be
  766.  
  767.             when you want your sorting to be case insensitive
  768.  
  769.          -->
  770.  
  771.         <filter class="solr.LowerCaseFilterFactory" />
  772.  
  773.         <!-- The TrimFilter removes any leading or trailing whitespace -->
  774.  
  775.         <filter class="solr.TrimFilterFactory" />
  776.  
  777.         <!-- The PatternReplaceFilter gives you the flexibility to use
  778.  
  779.             Java Regular expression to replace any sequence of characters
  780.  
  781.             matching a pattern with an arbitrary replacement string,
  782.  
  783.             which may include back references to portions of the original
  784.  
  785.             string matched by the pattern.
  786.  
  787.            
  788.  
  789.             See the Java Regular Expression documentation for more
  790.  
  791.             information on pattern and replacement string syntax.
  792.  
  793.            
  794.  
  795.             http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
  796.  
  797.          -->
  798.  
  799.         <filter class="solr.PatternReplaceFilterFactory"
  800.  
  801.                pattern="([^a-z])" replacement="" replace="all"
  802.  
  803.        />
  804.  
  805.       </analyzer>
  806.  
  807.     </fieldType>
  808.  
  809.    
  810.  
  811.     <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
  812.  
  813.       <analyzer>
  814.  
  815.         <tokenizer class="solr.StandardTokenizerFactory"/>
  816.  
  817.         <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
  818.  
  819.       </analyzer>
  820.  
  821.     </fieldtype>
  822.  
  823.  
  824.  
  825.     <fieldtype name="payloads" stored="false" indexed="true" class="solr.TextField" >
  826.  
  827.       <analyzer>
  828.  
  829.         <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  830.  
  831.         <!--
  832.  
  833.        The DelimitedPayloadTokenFilter can put payloads on tokens... for example,
  834.  
  835.        a token of "foo|1.4"  would be indexed as "foo" with a payload of 1.4f
  836.  
  837.        Attributes of the DelimitedPayloadTokenFilterFactory :
  838.  
  839.         "delimiter" - a one character delimiter. Default is | (pipe)
  840.  
  841.      "encoder" - how to encode the following value into a playload
  842.  
  843.         float -> org.apache.lucene.analysis.payloads.FloatEncoder,
  844.  
  845.         integer -> o.a.l.a.p.IntegerEncoder
  846.  
  847.         identity -> o.a.l.a.p.IdentityEncoder
  848.  
  849.            Fully Qualified class name implementing PayloadEncoder, Encoder must have a no arg constructor.
  850.  
  851.         -->
  852.  
  853.         <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
  854.  
  855.       </analyzer>
  856.  
  857.     </fieldtype>
  858.  
  859.  
  860.  
  861.     <!-- lowercases the entire field value, keeping it as a single token.  -->
  862.  
  863.     <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
  864.  
  865.       <analyzer>
  866.  
  867.         <tokenizer class="solr.KeywordTokenizerFactory"/>
  868.  
  869.         <filter class="solr.LowerCaseFilterFactory" />
  870.  
  871.       </analyzer>
  872.  
  873.     </fieldType>
  874.  
  875.  
  876.  
  877.     <fieldType name="text_path" class="solr.TextField" positionIncrementGap="100">
  878.  
  879.       <analyzer>
  880.  
  881.         <tokenizer class="solr.PathHierarchyTokenizerFactory"/>
  882.  
  883.       </analyzer>
  884.  
  885.     </fieldType>
  886.  
  887.  
  888.  
  889.     <!-- since fields of this type are by default not stored or indexed,
  890.  
  891.         any data added to them will be ignored outright.  -->
  892.  
  893.     <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
  894.  
  895.  
  896.  
  897.     <!-- This point type indexes the coordinates as separate fields (subFields)
  898.  
  899.      If subFieldType is defined, it references a type, and a dynamic field
  900.  
  901.      definition is created matching *___<typename>.  Alternately, if
  902.  
  903.      subFieldSuffix is defined, that is used to create the subFields.
  904.  
  905.      Example: if subFieldType="double", then the coordinates would be
  906.  
  907.        indexed in fields myloc_0___double,myloc_1___double.
  908.  
  909.      Example: if subFieldSuffix="_d" then the coordinates would be indexed
  910.  
  911.        in fields myloc_0_d,myloc_1_d
  912.  
  913.      The subFields are an implementation detail of the fieldType, and end
  914.  
  915.      users normally should not need to know about them.
  916.  
  917.     -->
  918.  
  919.     <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
  920.  
  921.  
  922.  
  923.     <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
  924.  
  925.     <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
  926.  
  927.  
  928.  
  929.    <!--
  930.  
  931.    A Geohash is a compact representation of a latitude longitude pair in a single field.
  932.  
  933.    See http://wiki.apache.org/solr/SpatialSearch
  934.  
  935.   -->
  936.  
  937.     <fieldtype name="geohash" class="solr.GeoHashField"/>
  938.  
  939.  </types>
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  <fields>
  946.  
  947.    <!-- Valid attributes for fields:
  948.  
  949.     name: mandatory - the name for the field
  950.  
  951.     type: mandatory - the name of a previously defined type from the
  952.  
  953.       <types> section
  954.  
  955.     indexed: true if this field should be indexed (searchable or sortable)
  956.  
  957.     stored: true if this field should be retrievable
  958.  
  959.     multiValued: true if this field may contain multiple values per document
  960.  
  961.     omitNorms: (expert) set to true to omit the norms associated with
  962.  
  963.       this field (this disables length normalization and index-time
  964.  
  965.       boosting for the field, and saves some memory).  Only full-text
  966.  
  967.       fields or fields that need an index-time boost need norms.
  968.  
  969.     termVectors: [false] set to true to store the term vector for a
  970.  
  971.       given field.
  972.  
  973.       When using MoreLikeThis, fields used for similarity should be
  974.  
  975.       stored for best performance.
  976.  
  977.     termPositions: Store position information with the term vector.  
  978.  
  979.       This will increase storage costs.
  980.  
  981.     termOffsets: Store offset information with the term vector. This
  982.  
  983.       will increase storage costs.
  984.  
  985.     default: a value that should be used if no value is specified
  986.  
  987.       when adding a document.
  988.  
  989.   -->
  990.  
  991.  
  992.  
  993.    <field name="id" type="string" indexed="true" stored="true" required="true" />
  994.  
  995.  
  996.  
  997.    <!-- Common metadata fields, named specifically to match up with
  998.  
  999.     SolrCell metadata when parsing rich documents such as Word, PDF.
  1000.  
  1001.     Some fields are multiValued only because Tika currently may return
  1002.  
  1003.     multiple values for them.
  1004.  
  1005.   -->
  1006. <!--
  1007.  
  1008.   <field name="title" type="text_general" indexed="true" stored="true" multiValued="true"/>
  1009.  
  1010.   <field name="subject" type="text_general" indexed="true" stored="true"/>
  1011.  
  1012.   <field name="description" type="text_general" indexed="true" stored="true"/>
  1013.  
  1014.   <field name="comments" type="text_general" indexed="true" stored="true"/>
  1015.  
  1016.   <field name="author" type="text_general" indexed="true" stored="true"/>
  1017.  
  1018.   <field name="keywords" type="text_general" indexed="true" stored="true"/>
  1019.  
  1020.   <field name="category" type="text_general" indexed="true" stored="true"/>
  1021.  
  1022.   <field name="content_type" type="string" indexed="true" stored="true" multiValued="true"/>
  1023.  
  1024.   <field name="last_modified" type="date" indexed="true" stored="true"/>
  1025.  
  1026.   <field name="links" type="string" indexed="true" stored="true" multiValued="true"/>
  1027.  
  1028. -->
  1029.  
  1030.  
  1031.  
  1032.    <!-- catchall field, containing all other searchable text fields (implemented
  1033.  
  1034.        via copyField further on in this schema  -->
  1035.  
  1036.    <field name="text" type="text_general" indexed="true" stored="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
  1037.  
  1038.  
  1039.  
  1040.    <!-- catchall text field that indexes tokens both normally and in reverse for efficient
  1041.  
  1042.        leading wildcard queries. -->
  1043.  
  1044.    <field name="text_rev" type="text_general_rev" indexed="true" stored="false" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.    <!-- Uncommenting the following will create a "timestamp" field using
  1053.  
  1054.        a default value of "NOW" to indicate when each document was indexed.
  1055.  
  1056.     -->
  1057.  
  1058.    <!--
  1059.  
  1060.   <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
  1061.  
  1062.     -->
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.    <!-- uncomment the following to ignore any fields that don't already match an existing
  1069.  
  1070.        field name or dynamic field, rather than reporting them as an error.
  1071.  
  1072.        alternately, change the type="ignored" to some other type e.g. "text" if you want
  1073.  
  1074.        unknown fields indexed and/or stored by default -->
  1075.  
  1076.  
  1077.    <dynamicField name="*" type="string"    indexed="true"  stored="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
  1078.  
  1079.    
  1080.  
  1081.  </fields>
  1082.  
  1083.  
  1084.  
  1085.  <!-- Field to use to determine and enforce document uniqueness.
  1086.  
  1087.      Unless this field is marked with required="false", it will be a required field
  1088.  
  1089.   -->
  1090.  
  1091.  <uniqueKey>id</uniqueKey>
  1092.  
  1093.  
  1094.  
  1095.  <!-- field for the QueryParser to use when an explicit fieldname is absent -->
  1096.  
  1097.  <defaultSearchField>text</defaultSearchField>
  1098.  
  1099.  
  1100.  
  1101.  <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
  1102.  
  1103.  <solrQueryParser defaultOperator="AND"/>
  1104.  
  1105.  
  1106.  
  1107.   <!-- copyField commands copy one field to another at the time a document
  1108.        is added to the index.  It's used either to index the same field differently,
  1109.        or to add multiple fields to the same field for easier/faster searching.  -->
  1110.  
  1111.    <copyField source="*" dest="text"/>
  1112.  
  1113.  
  1114.  
  1115. </schema>
Add Comment
Please, Sign In to add comment