Search index schema

Search index schema reference information to use for creating and altering a search index schema:

The schema defines the relationship between data in a table and a search index. See Creating a search index with default values and Quick Start for CQL index management for details and examples.

A sample search index schema XML:

Sample XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<schema name="autoSolrSchema" version="1.5">
  <types>
    <fieldType class="org.apache.solr.schema.TextField" name="TextField">
      <analyzer>
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType class="org.apache.solr.schema.TrieIntField" name="TrieIntField"/>
  </types>
  <fields>
    <field indexed="true" multiValued="false" name="grade_completed" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="diagnosed_thyroid_disease" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="pets" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="secondary_smoke" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="diagnosed_lupus" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="gender" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="birthplace" stored="true" type="TextField"/>
    <field docValues="true" indexed="true" multiValued="false" name="income_group" stored="true" type="TrieIntField"/>
    <field indexed="true" multiValued="false" name="marital_status" stored="true" type="TextField"/>
    <field docValues="true" indexed="true" multiValued="false" name="age_months" stored="true" type="TrieIntField"/>
    <field indexed="true" multiValued="false" name="bird" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="hay_fever" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="diagnosed_hay_fever" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="routine_medical_coverage" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="annual_income_20000" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="exam_status" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="other_pet" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="diagnosed_stroke" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="employer_paid_plan" stored="true" type="TextField"/>
    <field docValues="true" indexed="true" multiValued="false" name="family_sequence" stored="true" type="TrieIntField"/>
    <field indexed="true" multiValued="false" name="diagnosed_cataracts" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="major_medical_coverage" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="diagnosed_gout" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="age_unit" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="goiter" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="chronic_bronchitis" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="county" stored="true" type="TextField"/>
    <field docValues="true" indexed="true" multiValued="false" name="num_smokers" stored="true" type="TrieIntField"/>
    <field indexed="true" multiValued="false" name="screening_month" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="diagnosed_emphysema" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="diagnosed_other_cancer" stored="true" type="TextField"/>
    <field docValues="true" indexed="true" multiValued="false" name="id" stored="true" type="TrieIntField"/>
    <field indexed="true" multiValued="false" name="dental_coverage" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="health_status" stored="true" type="TextField"/>
    <field docValues="true" indexed="true" multiValued="false" name="monthly_income_total" stored="true" type="TrieIntField"/>
    <field indexed="true" multiValued="false" name="fish" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="dog" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="asthma" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="ethnicity" stored="true" type="TextField"/>
    <field docValues="true" indexed="true" multiValued="false" name="age" stored="true" type="TrieIntField"/>
    <field indexed="true" multiValued="false" name="diagnosed_asthma" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="race_ethnicity" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="diagnosed_congestive_heart_failure" stored="true" type="TextField"/>
    <field docValues="true" indexed="true" multiValued="false" name="family_size" stored="true" type="TrieIntField"/>
    <field indexed="true" multiValued="false" name="race" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="thyroid_disease" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="bronchitis" stored="true" type="TextField"/>
    <field docValues="true" indexed="true" multiValued="false" name="household_size" stored="true" type="TrieIntField"/>
    <field indexed="true" multiValued="false" name="cat" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="diagnosed_goiter" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="diagnosed_skin_cancer" stored="true" type="TextField"/>
    <field indexed="true" multiValued="false" name="fips" stored="true" type="TextField"/>
  </fields>
  <uniqueKey>(id,age)</uniqueKey>
</schema>

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com