Exemplo n.º 1
0
 function testWithQueryRange()
 {
     $index = new Search_Index_Memory();
     $query = new Search_Query();
     $query->filterRange(1000, 2000);
     $query->search($index);
     $expr = new Search_Expr_And(array(new Search_Expr_Range(1000, 2000, 'timestamp', 'modification_date')));
     $this->assertEquals($expr, $index->getLastQuery());
 }
Exemplo n.º 2
0
 private function cs_dataappend_daterange(Search_Query $query, $config, $value)
 {
     if ($vals = preg_split('/,/', $value)) {
         if (count($vals) == 2) {
             $from = $vals[0];
             $to = $vals[1];
             if (!empty($config['_field'])) {
                 $field = $config['_field'];
             } else {
                 $field = 'modification_date';
             }
             $query->filterRange($from, $to, $field);
         }
     }
 }