Installing the module #

Best practice is to use composer: composer require firesphere/solr-search

Manual setup #

class MyIndex extends BaseIndex
{
    /**
     * 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.
     * @throws Exception
     */
    public function init()
    {
        $this->addClass(SiteTree::class);

        $this->addFulltextField('Title');
    }
    
    public function getIndexName()
    {
        return 'this-is-my-index';
    }
}

Once these tasks have completed - happy searching!


Support our work

Buy Me a Coffee at ko-fi.com