PHP code example of silverstripe / solr

1. Go to this page and download the library: Download silverstripe/solr library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

silverstripe / solr example snippets


SolrSearchService::$solr_details = array();

Object::add_extension('SiteTree', 'SolrIndexable');

Object::add_extension('SiteTree', 'SiteTreePermissionIndexExtension');
Object::add_extension('ExtensibleSearchPage', 'SolrSearchPermissionIndexExtension');

SolrSearch::$facets = array('MetaKeywords_ms');

SolrSearchService::$java_bin

   <!-- SilverStripe multivalue field and sortable support -->
   <dynamicField name="*_ms"  type="string"  indexed="true"  stored="true" multiValued="true"/>
   <dynamicField name="*_as"  type="alphaOnlySort"  indexed="true"  stored="true"/>