| @@ 440-449 (lines=10) @@ | ||
| 437 | } |
|
| 438 | ||
| 439 | ||
| 440 | private function getResultsFor($query, $pageLength = 10, $fields = array('Title' => 1, 'Description' => 1)) { |
|
| 441 | $es = new ElasticSearcher(); |
|
| 442 | $es->setStart(0); |
|
| 443 | $es->setPageLength($pageLength); |
|
| 444 | $es->setClasses('FlickrPhotoTO'); |
|
| 445 | $resultList = $es->search($query, $fields)->getList(); |
|
| 446 | $this->assertEquals('SilverStripe\Elastica\ResultList', get_class($resultList)); |
|
| 447 | return $resultList; |
|
| 448 | } |
|
| 449 | } |
|
| 450 | ||
| @@ 776-786 (lines=11) @@ | ||
| 773 | } |
|
| 774 | ||
| 775 | ||
| 776 | private function getResultsFor($query, $pageLength = 10) { |
|
| 777 | $es = new ElasticSearcher(); |
|
| 778 | $es->setStart(0); |
|
| 779 | $es->setPageLength($pageLength); |
|
| 780 | //$es->addFilter('IsInSiteTree', false); |
|
| 781 | $es->setClasses('FlickrPhotoTO'); |
|
| 782 | $fields = array('Title' => 1, 'Description' => 1); |
|
| 783 | $resultList = $es->search($query, $fields)->getList(); |
|
| 784 | $this->assertEquals('SilverStripe\Elastica\ResultList', get_class($resultList)); |
|
| 785 | return $resultList; |
|
| 786 | } |
|
| 787 | ||
| 788 | } |
|
| 789 | ||