Ejemplo n.º 1
0
 /**
  * @param string $keywords
  * @param TypoScriptConfiguration $solrConfiguration
  */
 public function __construct($keywords, $solrConfiguration = null)
 {
     if ($solrConfiguration == null) {
         $this->solrConfiguration = Util::getSolrConfiguration();
     } else {
         $this->solrConfiguration = $solrConfiguration;
     }
     $this->setKeywords($keywords);
     $this->sorting = '';
     // What fields to search
     $queryFields = $this->solrConfiguration->getSearchQueryQueryFields();
     if ($queryFields != '') {
         $this->setQueryFieldsFromString($queryFields);
     }
     // What fields to return from Solr
     $this->fieldList = $this->solrConfiguration->getSearchQueryReturnFieldsAsArray(array('*', 'score'));
     $this->linkTargetPageId = $this->solrConfiguration->getSearchTargetPage();
     $this->id = ++self::$idCount;
 }