* @license http://github.com/basdenooijer/solarium/raw/master/COPYING * @link http://www.solarium-project.org/ * * @package Solarium * @subpackage Result */ /** * Select component morelikethis result item * * @package Solarium * @subpackage Result */ class Solarium_Result_Select_MoreLikeThis_Result implements IteratorAggregate, Countable { /** * Document instances array * * @var array */ protected $_documents; /** * Solr numFound * * This is NOT the number of MLT documents fetched from Solr! * * @var int */ protected $_numFound; /** * Maximum score in this MLT set * * @var float */ protected $_maximumScore; /** * Constructor * * @param int $numFound * @param float $maxScore * @param array $documents * @return void */ public function __construct($numFound, $maxScore, $documents) { $this->_numFound = $numFound; $this->_maximumScore = $maxScore; $this->_documents = $documents; } /** * get Solr numFound * * Returns the number of MLT documents found by Solr (this is NOT the * number of documents fetched from Solr!) * * @return int */ public function getNumFound() { return $this->_numFound; } /** * Get maximum score in the MLT document set * * @return float */ public function getMaximumScore() { return $this->_maximumScore; } /** * Get all documents * * @return array */ public function getDocuments() { return $this->_documents; } /** * IteratorAggregate implementation * * @return ArrayIterator */ public function getIterator() { return new ArrayIterator($this->_documents); } /** * Countable implementation * * @return int */ public function count() { return count($this->_documents); } }