예제 #1
0
 /**
  * constructor for class Tx_Solr_SuggestQuery
  */
 public function __construct($keywords)
 {
     parent::__construct('');
     $this->configuration = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['suggest.'];
     if (!empty($this->configuration['treatMultipleTermsAsSingleTerm'])) {
         $this->prefix = $this->escape($keywords);
     } else {
         $matches = array();
         preg_match('/^(:?(.* |))([^ ]+)$/', $keywords, $matches);
         $fullKeywords = trim($matches[2]);
         $partialKeyword = trim($matches[3]);
         $this->setKeywords($fullKeywords);
         $this->prefix = $this->escape($partialKeyword);
     }
     $this->setAlternativeQuery('*:*');
 }
예제 #2
0
 /**
  * constructor for class tx_solr_ExtractingQuery
  *
  * @param string $file Absolute path to the file to extract content and meta data from.
  */
 public function __construct($file)
 {
     parent::__construct('');
     $this->file = $file;
     $this->multiPartPostDataBoundary = '--' . md5(uniqid(time()));
 }