| Total Complexity | 2 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class TestIndex extends BaseIndex implements TestOnly |
||
| 11 | { |
||
| 12 | protected $facetFields = [ |
||
| 13 | SiteTree::class => [ |
||
| 14 | 'Title' => 'Parent', |
||
| 15 | 'Field' => 'ParentID' |
||
| 16 | ] |
||
| 17 | ]; |
||
| 18 | |||
| 19 | public function init(): void |
||
| 20 | { |
||
| 21 | $this->addClass(SiteTree::class); |
||
| 22 | $this->addFulltextField('Title'); |
||
| 23 | $this->addFulltextField('Content'); |
||
| 24 | $this->addFilterField('Title'); |
||
| 25 | $this->addFilterField('Created'); |
||
| 26 | $this->addSortField('Created'); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function getIndexName(): string |
||
| 30 | { |
||
| 31 | return 'TestIndex'; |
||
| 32 | } |
||
| 34 |