silverstripe-fulltextsearch/docs/examples/default_index.php.example

20 lines
495 B
Plaintext
Raw Normal View History

2018-06-12 16:45:47 +02:00
<?php
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\FullTextSearch\Solr\SolrIndex;
class DefaultIndex extends SolrIndex
{
/**
* Called during construction, this is the method that builds the structure.
* Used instead of overriding __construct as we have specific execution order - code that has
* to be run before _and/or_ after this.
*/
public function init()
{
$this->addClass(SiteTree::class);
$this->addAllFulltextFields();
}
}