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' => $showMatch), $request->getParams());
     $this->assertEquals($handler, $request->getHandler());
 }
示例#2
0
 /**
  * Build request for an analysis document query
  *
  * @param Solarium_Query_Analysis_Document $query
  * @return Solarium_Client_Request
  */
 public function build($query)
 {
     $request = parent::build($query);
     $request->setRawData($this->getRawData($query));
     $request->setMethod(Solarium_Client_Request::METHOD_POST);
     return $request;
 }
示例#3
0
 /**
  * Build request for an analysis field query
  *
  * @param Solarium_Query_Analysis_Field $query
  * @return Solarium_Client_Request
  */
 public function build($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;
 }