コード例 #1
0
ファイル: federatedsearchlib.php プロジェクト: rjsmelo/tiki
 private function addForIndex($query, $indexName, $index)
 {
     $sub = new Search_Query();
     foreach ($index->getTransformations() as $trans) {
         $sub->applyTransform($trans);
     }
     $query->includeForeign($indexName, $sub);
     return $sub;
 }
コード例 #2
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);
 }