コード例 #1
0
 function testTransformsApplyPerIndex()
 {
     $query = new Search_Query('Hello');
     $query->applyTransform(new Search\Federated\UrlPrefixTransform('http://foo.example.com'));
     $sub = new Search_Query('Hello');
     $sub->applyTransform(new Search\Federated\UrlPrefixTransform('http://bar.example.com/'));
     $query->includeForeign('test_index_c', $sub);
     $result = $query->search($this->indexA);
     $urls = [$result[0]['url'], $result[1]['url']];
     $this->assertContains('http://foo.example.com/PageA', $urls);
     $this->assertContains('http://bar.example.com/PageC', $urls);
 }