Exemplo n.º 1
0
 public function testBuildParams()
 {
     $this->query->setInterestingTerms('test');
     $this->query->setMatchInclude(true);
     $this->query->setStart(12);
     $this->query->setMltFields('description,name');
     $this->query->setMinimumTermFrequency(1);
     $this->query->setMinimumDocumentFrequency(3);
     $this->query->setMinimumWordLength(2);
     $this->query->setMaximumWordLength(15);
     $this->query->setMaximumQueryTerms(4);
     $this->query->setMaximumNumberOfTokens(5);
     $this->query->setBoost(true);
     $this->query->setQueryFields('description');
     $request = $this->builder->build($this->query);
     $this->assertEquals(array('mlt.interestingTerms' => 'test', 'mlt.match.include' => 'true', 'mlt.match.offset' => 12, 'mlt.fl' => 'description,name', 'mlt.mintf' => 1, 'mlt.mindf' => 3, 'mlt.minwl' => 2, 'mlt.maxwl' => 15, 'mlt.maxqt' => 4, 'mlt.maxntp' => 5, 'mlt.boost' => 'true', 'mlt.qf' => 'description', 'q' => '*:*', 'fl' => '*,score', 'rows' => 10, 'start' => 12, 'wt' => 'json', 'omitHeader' => 'true', 'json.nl' => 'flat'), $request->getParams());
     $this->assertEquals(Request::METHOD_GET, $request->getMethod());
 }