function __construct($query) { $qstr = $query->__toString(); // query needs the object_type field removing for highlighting $qstr = preg_replace('/\\+?\\(\\(object_type.*?\\)\\)/', '', $qstr); // this is the only way i can find to remove a term form a query $query = ZendSearch\Lucene\Search\QueryParser::parse($qstr, 'UTF-8'); // rebuild $this->query = $query; $this->snippetHelper = new Search_ResultSet_SnippetHelper(); }
private function buildQuery($expr) { $query = (string) $expr->walk(array($this, 'walkCallback')); // FIX : Depending on the locale, decimals may be rendered as 1,2 instead of 1.2, causing lucene to go crazy $query = preg_replace('/\\^(\\d+),(\\d+)/', '^$1.$2', $query); return ZendSearch\Lucene\Search\QueryParser::parse($query, 'UTF-8'); }