source: sandbox/expresso-solr/expressoMail1_2/inc/solrclient/examples/6.4-dereferenced-params.php @ 7576

Revision 7576, 913 bytes checked in by adir, 11 years ago (diff)

Ticket #000 - Adicionando a integracao de buscas com Solr na base a ser isnerida na comunidade

Line 
1<?php
2
3require('init.php');
4htmlHeader();
5
6// create a client instance and get a select query instance
7$client = new Solarium_Client($config);
8
9
10
11
12// first an example manually defining dereferenced params
13$query = $client->createSelect();
14$helper = $query->getHelper();
15
16$join = $helper->qparser('join', array('from' => 'manu_id', 'to' => 'id'), true);
17$queryString = $join . 'id:1';
18$query->setQuery($queryString);
19$request = $client->createRequest($query);
20
21// output resulting url with dereferenced params
22echo urldecode($request->getUri()) . '<hr/>';
23
24
25
26
27// this second example gives the exact same result, using the special join helper
28$query = $client->createSelect();
29$helper = $query->getHelper();
30
31$join = $helper->join('manu_id', 'id', true);
32$queryString = $join . 'id:1';
33$query->setQuery($queryString);
34$request = $client->createRequest($query);
35
36echo urldecode($request->getUri());
37
38
39
40
41htmlFooter();
Note: See TracBrowser for help on using the repository browser.