Ejemplo n.º 1
0
 /**
  * Map parser data into properties
  *
  * @param  array $mapData
  * @return void
  */
 protected function mapData($mapData)
 {
     foreach ($mapData as $key => $data) {
         if ($key == 'documents') {
             $filter = new Filter();
             $mode = $this->getQuery()->getFilterMode();
             $ratio = $this->getQuery()->getFilterRatio();
             $data = $filter->filterDocuments($data, $mapData['maxscore'], $ratio, $mode);
         }
         $this->{$key} = $data;
     }
 }
Ejemplo n.º 2
0
 /**
  * Get all documents, apply filter at first use
  *
  * @return array
  */
 public function getDocuments()
 {
     if (!$this->filtered) {
         $filter = new Filter();
         $this->documents = $filter->filterDocuments($this->documents, self::$overallMaximumScore, $this->filterRatio, $this->filterMode);
         $this->filtered = true;
     }
     return $this->documents;
 }