Esempio n. 1
0
 public function testQueryBuilding()
 {
     $query = new MoviesFrom2014Query($this->getElasticSearcher());
     $query->run();
     // Needed because this calls setUp inside the query.
     $this->assertEquals(['movies'], $query->getIndices());
     $this->assertEquals(['movies'], $query->getTypes());
     $expectedQuery = ['index' => 'movies', 'type' => 'movies', 'body' => ['query' => ['filtered' => ['filter' => [['term' => ['year' => 2014]]]]]]];
     $this->assertEquals($expectedQuery, $query->getRawQuery());
 }