Esempio n. 1
0
 /**
  * Test generation with highlighting
  *
  * @return void
  */
 public function testHighlighting()
 {
     $qb = new QueryBuilder(['test' => ['DismaxFields' => ['test1'], 'DismaxParams' => [['bq', 'boost']]]]);
     $q = new Query('*:*', 'test');
     // No hl.q if highlighting query disabled:
     $qb->setCreateHighlightingQuery(false);
     $response = $qb->build($q);
     $hlQ = $response->get('hl.q');
     $this->assertEquals(null, $hlQ[0]);
     // hl.q if highlighting query enabled:
     $qb->setCreateHighlightingQuery(true);
     $response = $qb->build($q);
     $hlQ = $response->get('hl.q');
     $this->assertEquals('*:*', $hlQ[0]);
 }