Example #1
0
 public function testBuild()
 {
     $query = 'cat:1';
     $showMatch = true;
     $handler = 'myhandler';
     $this->query->setQuery($query)->setShowMatch($showMatch)->setHandler($handler);
     $request = $this->builder->build($this->query);
     $this->assertEquals(array('wt' => 'json', 'analysis.query' => $query, 'analysis.showmatch' => 'true', 'json.nl' => 'flat', 'omitHeader' => 'true'), $request->getParams());
     $this->assertEquals($handler, $request->getHandler());
 }
Example #2
0
 /**
  * Build request for an analysis field query
  *
  * @param  QueryField $query
  * @return Request
  */
 public function build(QueryInterface $query)
 {
     $request = parent::build($query);
     $request->addParam('analysis.fieldvalue', $query->getFieldValue());
     $request->addParam('analysis.fieldname', $query->getFieldName());
     $request->addParam('analysis.fieldtype', $query->getFieldType());
     return $request;
 }