/**
  * Overridden field definitions to define additional custom fields like sort
  * fields and additional functionality.
  *
  * @return string
  */
 public function getFieldDefinitions()
 {
     $xml = parent::getFieldDefinitions();
     $stored = Director::isDev() ? "stored='true'" : "stored='false'";
     $xml .= "\n\n\t\t<!-- Additional custom fields for sorting, see PageSolrIndex.php -->";
     $xml .= "\n\t\t<field name='Title' type='alphaOnlySort' indexed='true' stored='true' />";
     $xml .= "\n\t\t<field name='LastEdited' type='tdate' indexed='true' stored='true' />";
     $xml .= "\n\n\t\t<!-- Additional custom fields for spell checking, see PageSolrIndex.php -->";
     $xml .= "\n\t\t<field name='spellcheckData' type='textSpell' {$stored} indexed='true' multiValued='true' />";
     $xml .= "\n\t\t<field name='highlightData' type='htmltext' stored='true' indexed='true' multiValued='true' />";
     return $xml;
 }
 /**
  * @return string
  */
 public function getFieldDefinitions()
 {
     $xml = parent::getFieldDefinitions();
     //		$xml .= "\n\t\t<field name='_spellcheckContent' type='htmltext' indexed='true' stored='false' multiValued='true' />";
     // create a sorting column
     if (isset($this->fieldMap['Title']) || ShopSearch::config()->solr_title_sort_field) {
         $f = empty(ShopSearch::config()->title_sort_field) ? '_titleSort' : ShopSearch::config()->solr_title_sort_field;
         $xml .= "\n\t\t" . '<field name="' . $f . '" type="alphaOnlySort" indexed="true" stored="false" required="false" multiValued="false" />';
         $xml .= "\n\t\t" . '<copyField source="SiteTree_Title" dest="' . $f . '"/>';
     }
     // create an autocomplete column
     if (ShopSearch::config()->suggest_enabled) {
         $xml .= "\n\t\t<field name='_autocomplete' type='autosuggest_text' indexed='true' stored='false' multiValued='true'/>";
     }
     return $xml;
 }