예제 #1
0
파일: Query.php 프로젝트: hnadler/ext-solr
 /**
  * @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;
 }