2017-04-21 03:18:37 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\FullTextSearch\Tests\SolrIndexTest;
|
|
|
|
|
|
|
|
use SilverStripe\FullTextSearch\Solr\SolrIndex;
|
2017-04-26 12:52:20 +02:00
|
|
|
use SilverStripe\FullTextSearch\Tests\SearchUpdaterTest\SearchUpdaterTest_Container;
|
2017-04-21 03:18:37 +02:00
|
|
|
|
|
|
|
class SolrIndexTest_BoostedIndex extends SolrIndex
|
|
|
|
{
|
|
|
|
protected function getStoredDefault()
|
|
|
|
{
|
|
|
|
// Override isDev defaulting to stored
|
|
|
|
return 'false';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function init()
|
|
|
|
{
|
2017-04-26 12:52:20 +02:00
|
|
|
$this->addClass(SearchUpdaterTest_Container::class);
|
2017-04-21 03:18:37 +02:00
|
|
|
$this->addAllFulltextFields();
|
2017-04-26 12:52:20 +02:00
|
|
|
$this->setFieldBoosting(SearchUpdaterTest_Container::class . '_Field1', 1.5);
|
2017-04-21 03:18:37 +02:00
|
|
|
$this->addBoostedField('Field2', null, array(), 2.1);
|
|
|
|
}
|
|
|
|
}
|