Skip to content
bgreenwood edited this page Aug 13, 2012 · 2 revisions

SOLR Schema

N.B. This is no longer the latest version of the SOLR Schema.

See SOLRSchemaLatest instead.

Release 8

Schema changes (Release 8):

  • Standardise naming of ANDS-indexed fields
  • Include hash of key and data source key for unique identification
  • Include metadata assessment quality fields for retrieval from the index
  • Add subject/vocabulary resolution fields
  • Add indexing of license type fields
  • Add search_base_score for algorithmic weighting of search results

/solr/conf/schema.xml

Direct Download

<?xml version="1.0" encoding="UTF-8" ?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<!--  
 This is the Solr schema file. This file should be named "schema.xml" and
 should be in the conf directory under the solr home
 (i.e. ./solr/conf/schema.xml by default) 
 or located where the classloader for the Solr webapp can find it.

 For more information, on how to customize this file, please see
 http://wiki.apache.org/solr/SchemaXml
-->

<schema name="ands_online_services" version="1.3">

 <fields>
    
   <!-- 
   	ANDS Indexed Fields
   -->  
   
   <!-- Single Value Fields-->
   <field name="key" type="string" indexed="true" stored="true" required="true" /> 
   <field name="keyText" type="text" indexed="true" stored="true" required="true" /> 
   <field name="key_hash" type="string" indexed="true" stored="true" required="true" />
   <field name="url_slug" type="string" indexed="true" stored="true" required="false" />
   <field name="data_source_key_hash" type="string" indexed="true" stored="true" required="true" />
   <field name="status" type="string" indexed="true" stored="true"/>
   <field name="class" type="string" indexed="true" stored="true"/>
   <field name="reverse_links" type="string" indexed="true" stored="true"/>
   <field name="originating_source" type="string" indexed="true" stored="true"/>
   <field name="data_source_key" type="string" indexed="true" stored="true"/>
   
   <field name="date_modified" type="pdate" indexed="true" stored="true"/>
   
   <!-- Anything that starts with s_ is alpha only sort-->
   <field name="group" type="string" indexed="true" stored="true"/>
   <field name="s_group" type="alphaOnlySort" indexed="true"/>

   <field name="type" type="string" indexed="true" stored="true"/>
   <field name="s_type" type="alphaOnlySort" indexed="true"/>
   
   <!-- Search Base Score being a sortable int-->
   <field name="search_base_score" type="sint" indexed="true" stored="true"/>
   	
   <field name="flag" type="sint" indexed="true" stored="true"/>
   <field name="warning_count" type="sint" indexed="true" stored="true"/>
   <field name="error_count" type="sint" indexed="true" stored="true"/>
   <field name="manually_assessed_flag" type="sint" indexed="true" stored="true"/>
   <field name="gold_status_flag" type="sint" indexed="true" stored="true"/>
   <field name="quality_level" type="sint" indexed="true" stored="true"/>


   <field name="feed_type" type="string" indexed="true" stored="true"/>
   <field name="last_modified_by" type="string" indexed="true" stored="true"/>

   <!-- Names-->
   <field name="display_title" type="text" indexed="true" stored="true"/>
   <field name="list_title" type="text" indexed="true" stored="true"/>
   <field name="s_list_title" type="alphaOnlySort" indexed="true" stored="false"/>
   <field name="alt_list_title" type="text" indexed="true" stored="true" multiValued="true"/>
   <field name="alt_display_title" type="text" indexed="true" stored="true" multiValued="true"/>


	<!-- Not sure what to use name part for, but leave for now-->
   <field name="name_part_type" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="name_part" type="string" indexed="true" stored="true" multiValued="true"/>
   
   <!-- Location all cramped into 1-->
   <field name="location" type="text" indexed="true" stored="true" multiValued="true"/>
   
   <!-- MultiValued relatedObjects -->
   <field name="related_object_key" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="related_object_class" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="related_object_type" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="related_object_list_title" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="related_object_display_title" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="related_object_relation" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="related_object_display_logo" type="string" indexed="true" stored="true" multiValued="true"/>
  
   <!-- MultiValued Descriptions-->
   <field name="description_value" type="text" indexed="true" stored="true" multiValued="true"/>
   <field name="description_type" type="string" indexed="true" stored="true" multiValued="true"/>
   
   <!-- MultiValued Subjects-->
   <field name="subject_value_resolved" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="subject_value_unresolved" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="s_subject_value_resolved" type="alphaOnlySort" indexed="true" stored="false" multiValued="true"/>
   <field name="subject_type" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="subject_vocab_uri" type="string" indexed="true" stored="false" multiValued="true"/>
  
   <!-- MultiValued Broader Subjects-->
   <field name="broader_subject_value_resolved" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="broader_subject_value_unresolved" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="broader_subject_type" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="broader_subject_vocab_uri" type="string" indexed="true" stored="false" multiValued="true"/>

   <!-- licence group -->
   <field name="licence_group" type="string" indexed="true" stored="true" required="false" multiValued="true"/>
   
   <!-- relatedInfo all cramped into 1-->
   <field name="related_info" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="date_from" type="int" indexed="true" stored="true" multiValued="true"/>
   <field name="date_to" type="int" indexed="true" stored="true" multiValued="true"/>

   <field name="identifier_value" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="identifier_type" type="string" indexed="true" stored="true" multiValued="true"/>

   <field name="spatial_coverage" type="string" indexed="true" stored="true" multiValued="true"/>
   <field name="spatial_coverage_center" type="string" indexed="true" stored="true" multiValued="true"/>
   
   <!-- END ANDS Indexed Field-->

  <!-- Valid attributes for fields:
     name: mandatory - the name for the field
     type: mandatory - the name of a previously defined type from the 
       <types> section
     indexed: true if this field should be indexed (searchable or sortable)
     stored: true if this field should be retrievable
     multiValued: true if this field may contain multiple values per document
     omitNorms: (expert) set to true to omit the norms associated with
       this field (this disables length normalization and index-time
       boosting for the field, and saves some memory).  Only full-text
       fields or fields that need an index-time boost need norms.
     termVectors: [false] set to true to store the term vector for a
       given field.
       When using MoreLikeThis, fields used for similarity should be
       stored for best performance.
     termPositions: Store position information with the term vector.  
       This will increase storage costs.
     termOffsets: Store offset information with the term vector. This 
       will increase storage costs.
     default: a value that should be used if no value is specified
       when adding a document.
   -->


   <!-- catchall field, containing all other searchable text fields (implemented
        via copyField further on in this schema  -->
   <field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
   <field name="fulltext" type="text" indexed="true" stored="false" multiValued="true"/>

   
   <!-- Dynamic field definitions.  If a field name is not found, dynamicFields
        will be used if the name matches any of the patterns.
        RESTRICTION: the glob-like pattern in the name attribute must have
        a "*" only at the start or the end.
        EXAMPLE:  name="*_i" will match any field ending in _i (like myid_i, z_i)
        Longer patterns will be matched first.  if equal size patterns
        both match, the first appearing in the schema will be used.  -->
   <dynamicField name="*_i"  type="int"    indexed="true"  stored="true"/>
   <dynamicField name="*_s"  type="string"  indexed="true"  stored="true"/>
   <dynamicField name="*_l"  type="long"   indexed="true"  stored="true"/>
   <dynamicField name="*_t"  type="text"    indexed="true"  stored="true"/>
   <dynamicField name="*_txt" type="text"    indexed="true"  stored="true" multiValued="true"/>
   <dynamicField name="*_b"  type="boolean" indexed="true"  stored="true"/>
   <dynamicField name="*_f"  type="float"  indexed="true"  stored="true"/>
   <dynamicField name="*_d"  type="double" indexed="true"  stored="true"/>

   <!-- Type used to index the lat and lon components for the "location" FieldType -->
   <dynamicField name="*_coordinate"  type="tdouble" indexed="true"  stored="false"/>

   <dynamicField name="*_dt" type="date"    indexed="true"  stored="true"/>
   <dynamicField name="*_p"  type="location" indexed="true" stored="true"/>

   <!-- some trie-coded dynamic fields for faster range queries -->
   <dynamicField name="*_ti" type="tint"    indexed="true"  stored="true"/>
   <dynamicField name="*_tl" type="tlong"   indexed="true"  stored="true"/>
   <dynamicField name="*_tf" type="tfloat"  indexed="true"  stored="true"/>
   <dynamicField name="*_td" type="tdouble" indexed="true"  stored="true"/>
   <dynamicField name="*_tdt" type="tdate"  indexed="true"  stored="true"/>

   <dynamicField name="*_pi"  type="pint"    indexed="true"  stored="true"/>

   <dynamicField name="ignored_*" type="ignored" multiValued="true"/>
   <dynamicField name="attr_*" type="textgen" indexed="true" stored="true" multiValued="true"/>

   <dynamicField name="random_*" type="random" />
   
 </fields>



 <!-- Field to use to determine and enforce document uniqueness. 
      Unless this field is marked with required="false", it will be a required field
   -->
 <uniqueKey>key_hash</uniqueKey>

  <!-- field for the QueryParser to use when an explicit fieldname is absent -->
  <defaultSearchField>description_value</defaultSearchField>



  <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
  <solrQueryParser defaultOperator="AND"/>



  <!-- copyField commands copy one field to another at the time a document
        is added to the index.  It's used either to index the same field differently,
        or to add multiple fields to the same field for easier/faster searching.  -->
  <copyField source="*" dest="fulltext"/>
  <copyField source="key" dest="keyText"/>
  <copyField source="group" dest="s_group"/>
  <copyField source="type" dest="s_type"/>
  <copyField source="list_title" dest="s_list_title"/>
  <copyField source="subject_value_resolved" dest="s_subject_value_resolved"/>
 
  <types>
    <!-- field type definitions -->
    <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
    <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
    <fieldtype name="binary" class="solr.BinaryField"/>
    <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
    <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
    <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
    <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
    <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
    <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
    <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
    <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
    <fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
    <fieldType name="pint" class="solr.IntField" omitNorms="true"/>
    <fieldType name="plong" class="solr.LongField" omitNorms="true"/>
    <fieldType name="pfloat" class="solr.FloatField" omitNorms="true"/>
    <fieldType name="pdouble" class="solr.DoubleField" omitNorms="true"/>
    <fieldType name="pdate" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>
    <fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
    <fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
    <fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
    <fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>
    <fieldType name="random" class="solr.RandomSortField" indexed="true" />
    <fieldType name="text_greek" class="solr.TextField">
      <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
    </fieldType>
    <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="text" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="stopwords.txt"
                enablePositionIncrements="true"
                />
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="stopwords.txt"
                enablePositionIncrements="true"
                />
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="textTight" class="solr.TextField" positionIncrementGap="100" >
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
        <filter class="solr.EnglishMinimalStemFilterFactory"/>
        <!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
             possible with WordDelimiterFilter in conjuncton with stemming. -->
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="textgen" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="stopwords.txt"
                enablePositionIncrements="true"
                />
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="text_rev" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
           maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="stopwords.txt"
                enablePositionIncrements="true"
                />
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
      <analyzer>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
        <filter class="solr.TrimFilterFactory" />
        <filter class="solr.PatternReplaceFilterFactory"
                pattern="([^a-z])" replacement="" replace="all"
        />
      </analyzer>
    </fieldType>
    
    <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
      <analyzer>
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
      </analyzer>
    </fieldtype>

    <fieldtype name="payloads" stored="false" indexed="true" class="solr.TextField" >
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
      </analyzer>
    </fieldtype>

    <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
      </analyzer>
    </fieldType>

    <fieldType name="text_path" class="solr.TextField" positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.PathHierarchyTokenizerFactory"/>
      </analyzer>
    </fieldType>
    <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
    <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
    <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
    <fieldtype name="geohash" class="solr.GeoHashField"/>
 </types>



</schema>