Guest User

Untitled

a guest
Jan 24th, 2011
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 11.17 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.2">
  49.   <!-- attribute "name" is the name of this schema and is only used for display purposes.
  50.       Applications should change this to reflect the nature of the search collection.
  51.       version="1.2" is Solr's version number for the schema syntax and semantics.  It should
  52.       not normally be changed by applications.
  53.       1.0: multiValued attribute did not exist, all fields are multiValued by nature
  54.       1.1: multiValued attribute introduced, false by default
  55.       1.2: omitTermFreqAndPositions attribute introduced, true by default except for text fields.
  56.     -->
  57.  
  58.   <types>
  59.     <!-- field type definitions. The "name" attribute is
  60.       just a label to be used by field definitions.  The "class"
  61.       attribute and any other attributes determine the real
  62.       behavior of the fieldType.
  63.         Class names starting with "solr" refer to java classes in the
  64.       org.apache.solr.analysis package.
  65.    -->
  66.  
  67.     <!-- The StrField type is not analyzed, but indexed/stored verbatim.  
  68.       - StrField and TextField support an optional compressThreshold which
  69.       limits compression (if enabled in the derived fields) to values which
  70.       exceed a certain size (in characters).
  71.    -->
  72.      
  73.      
  74.     <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
  75.        
  76.       <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
  77.    
  78.         <analyzer>
  79.    
  80.           <tokenizer class="solr.KeywordTokenizerFactory"/>
  81.  
  82.           <filter class="solr.LowerCaseFilterFactory" />
  83.    
  84.         </analyzer>
  85.    
  86.       </fieldType>
  87.    
  88.      
  89.  
  90.    
  91.  
  92.        <fieldType name="genericID" class="solr.TextField" sortMissingLast="true"  omitNorms="true">
  93.  
  94.          <analyzer>
  95.  
  96.            <tokenizer class="solr.KeywordTokenizerFactory"/>
  97.  
  98.            <filter class="solr.LowerCaseFilterFactory"/>
  99.  
  100.            <filter class="solr.TrimFilterFactory"/>
  101.  
  102.            <filter class="solr.PatternReplaceFilterFactory"
  103.  
  104.                pattern="[^\p{L}\p{N}]" replacement=""  replace="all"
  105.  
  106.           />
  107.  
  108.          </analyzer>
  109.  
  110.       </fieldType>
  111.  
  112.        
  113.  
  114.      
  115.       <fieldType name="numeric" class="solr.TextField" sortMissingLast="true" omitNorms="true" >
  116.  
  117.        <analyzer>
  118.  
  119.          <tokenizer class="solr.KeywordTokenizerFactory"/>
  120.  
  121.          <filter class="solr.LowerCaseFilterFactory"/>
  122.  
  123.          <filter class="solr.TrimFilterFactory"/>
  124.  
  125.          <filter class="solr.PatternReplaceFilterFactory"
  126.  
  127.              pattern="[^0-9]*([0-9]+)[^0-9]*" replacement="$1"
  128.  
  129.         />
  130.  
  131.          <filter class="solr.PatternReplaceFilterFactory"
  132.  
  133.              pattern="^0*(.*)" replacement="$1"
  134.  
  135.         />
  136.  
  137.        </analyzer>
  138.  
  139.       </fieldType>
  140.  
  141.        
  142.    <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
  143.       <analyzer type="index">
  144.         <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  145.         <!-- in this example, we will only use synonyms at query time
  146.        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
  147.        -->
  148.         <!-- Case insensitive stop word removal.
  149.          add enablePositionIncrements=true in both the index and query
  150.          analyzers to leave a 'gap' for more accurate phrase queries.
  151.        -->
  152.         <filter class="solr.StopFilterFactory"
  153.                ignoreCase="true"
  154.                words="stopwords.txt"
  155.                enablePositionIncrements="true"
  156.                />
  157.         <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
  158.         <filter class="solr.LowerCaseFilterFactory"/>
  159.         <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
  160.       </analyzer>
  161.       <analyzer type="query">
  162.         <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  163.         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
  164.         <filter class="solr.StopFilterFactory"
  165.                ignoreCase="true"
  166.                words="stopwords.txt"
  167.                enablePositionIncrements="true"
  168.                />
  169.         <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
  170.         <filter class="solr.LowerCaseFilterFactory"/>
  171.         <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
  172.       </analyzer>
  173.     </fieldType>
  174.          
  175.  
  176.    
  177.  </types>
  178.  
  179.  
  180.  <fields>
  181.    <!-- Valid attributes for fields:
  182.     name: mandatory - the name for the field
  183.     type: mandatory - the name of a previously defined type from the
  184.       <types> section
  185.     indexed: true if this field should be indexed (searchable or sortable)
  186.     stored: true if this field should be retrievable
  187.     compressed: [false] if this field should be stored using gzip compression
  188.       (this will only apply if the field type is compressable; among
  189.       the standard field types, only TextField and StrField are)
  190.     multiValued: true if this field may contain multiple values per document
  191.     omitNorms: (expert) set to true to omit the norms associated with
  192.       this field (this disables length normalization and index-time
  193.       boosting for the field, and saves some memory).  Only full-text
  194.       fields or fields that need an index-time boost need norms.
  195.     termVectors: [false] set to true to store the term vector for a
  196.       given field.
  197.       When using MoreLikeThis, fields used for similarity should be
  198.       stored for best performance.
  199.     termPositions: Store position information with the term vector.  
  200.       This will increase storage costs.
  201.     termOffsets: Store offset information with the term vector. This
  202.       will increase storage costs.
  203.     default: a value that should be used if no value is specified
  204.       when adding a document.
  205.   -->
  206.  
  207.    
  208. <field name="month"        type="string"          indexed="true"  stored="true"  required="true" />
  209.  
  210. <field name="date"       type="numeric"         indexed="true"  stored="true"/>
  211.  
  212.  
  213.  
  214. <field name="time"       type="genericID"         indexed="true"  stored="true"/>
  215.  
  216. <field name="DHCP_ip"       type="genericID"         indexed="true"  stored="true"/>
  217.  
  218. <field name="protocol"       type="genericID"         indexed="true"  stored="true"/>
  219.  
  220. <field name="DHCPMESSAGE"       type="text"         indexed="true"  stored="true"/>
  221.  
  222. <field name="location"       type="text"         indexed="true"  stored="true"/>
  223.  
  224. <field name="from_mac"       type="genericID"         indexed="true"  stored="true"/>
  225.  
  226. <field name="way"       type="text"         indexed="true"  stored="true"/>
  227.  
  228. <field name="gateway_ip"       type="genericID"         indexed="true"  stored="true"/>
  229.  
  230. <field name="Name"       type="text"         indexed="true"  stored="true"/>
  231.  
  232. <field name="net_ADDR"       type="genericID"         indexed="true"  stored="true"/>
  233.  
  234. <field name="t1"       type="text"         indexed="true"  stored="true"/>
  235.  
  236.  
  237. <field name="t2"       type="text"         indexed="true"  stored="true"/>
  238.  
  239. <field name="t3"     type="text"         indexed="true"  stored="true"/>
  240.  </fields>
  241.  
  242.  <!-- Field to use to determine and enforce document uniqueness.
  243.      Unless this field is marked with required="false", it will be a required field
  244.   -->
  245. <uniqueKey>month</uniqueKey>
  246.  
  247.  <!-- field for the QueryParser to use when an explicit fieldname is absent -->
  248.  
  249.  
  250.  <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
  251.  <solrQueryParser defaultOperator="OR"/>
  252.  
  253.   <!-- copyField commands copy one field to another at the time a document
  254.        is added to the index.  It's used either to index the same field differently,
  255.        or to add multiple fields to the same field for easier/faster searching.  -->
  256.  
  257.    
  258.    <!-- Above, multiple source fields are copied to the [text] field.
  259.       Another way to map multiple source fields to the same
  260.       destination field is to use the dynamic field syntax.
  261.       copyField also supports a maxChars to copy setting.  -->
  262.        
  263.    <!-- <copyField source="*_t" dest="text" maxChars="3000"/> -->
  264.  
  265.    <!-- copy name to alphaNameSort, a field designed for sorting by name -->
  266.    <!-- <copyField source="name" dest="alphaNameSort"/> -->
  267.  
  268.  
  269.  <!-- Similarity is the scoring routine for each document vs. a query.
  270.      A custom similarity may be specified here, but the default is fine
  271.      for most applications.  -->
  272.  <!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/> -->
  273.  <!-- ... OR ...
  274.      Specify a SimilarityFactory class name implementation
  275.      allowing parameters to be used.
  276. -->
  277.  <!--
  278. <similarity class="com.example.solr.CustomSimilarityFactory">
  279.   <str name="paramkey">param value</str>
  280. </similarity>
  281. -->
  282.  
  283.  
  284. </schema>
Advertisement
Add Comment
Please, Sign In to add comment