示例#1
0
 public function testBuildParams()
 {
     $this->query->setFields('fieldA,fieldB');
     $this->query->setLowerbound('d');
     $this->query->setLowerboundInclude(true);
     $this->query->setMinCount(3);
     $this->query->setMaxCount(100);
     $this->query->setPrefix('de');
     $this->query->setRegex('det.*');
     $this->query->setRegexFlags('case_insensitive,comments');
     $this->query->setLimit(50);
     $this->query->setUpperbound('x');
     $this->query->setUpperboundInclude(false);
     $this->query->setRaw(false);
     $this->query->setSort('index');
     $request = $this->builder->build($this->query);
     $this->assertEquals(array('terms' => 'true', 'terms.fl' => array('fieldA', 'fieldB'), 'terms.limit' => 50, 'terms.lower' => 'd', 'terms.lower.incl' => 'true', 'terms.maxcount' => 100, 'terms.mincount' => 3, 'terms.prefix' => 'de', 'terms.raw' => 'false', 'terms.regex' => 'det.*', 'terms.regex.flag' => array('case_insensitive', 'comments'), 'terms.sort' => 'index', 'terms.upper' => 'x', 'terms.upper.incl' => 'false', 'wt' => 'json', 'json.nl' => 'flat', 'omitHeader' => 'true'), $request->getParams());
     $this->assertEquals(Request::METHOD_GET, $request->getMethod());
 }
示例#2
0
 public function testSetAndGetUpperbound()
 {
     $this->query->setUpperbound('x');
     $this->assertEquals('x', $this->query->getUpperbound());
 }