Create a custom schema

Advanced DSE Search tutorial steps to replace the basic tutorial Solr schema with a custom schema.

These advanced DSE Search tutorial steps replace the basic tutorial Solr schema with a custom schema. The tutorial files that you downloaded in the basic tutorial include a Solr schema and a solrconfig file.


Follow these steps to replace the schema with a custom schema that corresponds to the hits table and defines a dynamic field:

  1. Open the schema.xml in the solr_tutorial46 directory.
  2. Compare the schema with the corresponding hits table that you created.
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <schema name="topHits" version="1.5">
        <fieldType class="org.apache.solr.schema.TextField" name="TextField">
            <tokenizer class="solr.StandardTokenizerFactory"/>
        <fieldType class="org.apache.solr.schema.UUIDField" name="UUIDField"/>
      <dynamicField indexed="true" multiValued="false" name="lang_*" stored="true" type="TextField"/>
      <field indexed="true" multiValued="false" name="song" stored="true" type="UUIDField"/>

    The uniqueKey is the name of the CQL primary key. The dynamicField is the name of the CQL lang_ column plus the asterisk wildcard suffix. A tokenizer determines the parsing of the example text. The fields specify the data that Solr indexes and stores. You will be able to query on data using lang_*, as shown later in this tutorial.