Revision 7588,
913 bytes
checked in by adir, 12 years ago
(diff) |
Ticket #000 - Adicionando a integracao de buscas com Solr na base a ser isnerida na comunidade
|
Rev | Line | |
---|
[7588] | 1 | <?php |
---|
| 2 | |
---|
| 3 | require('init.php'); |
---|
| 4 | htmlHeader(); |
---|
| 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 |
---|
| 22 | echo 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 | |
---|
| 36 | echo urldecode($request->getUri()); |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | htmlFooter(); |
---|
Note: See
TracBrowser
for help on using the repository browser.