Revision 7588,
552 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
|
Rev | Line | |
---|
[7588] | 1 | <?php |
---|
| 2 | |
---|
| 3 | require('init.php'); |
---|
| 4 | htmlHeader(); |
---|
| 5 | |
---|
| 6 | // create a client instance |
---|
| 7 | $client = new Solarium_Client($config); |
---|
| 8 | |
---|
| 9 | // get a terms query instance |
---|
| 10 | $query = $client->createTerms(); |
---|
| 11 | $query->setFields('features,name'); |
---|
| 12 | $query->setLowerbound('i'); |
---|
| 13 | |
---|
| 14 | // this executes the query and returns the result |
---|
| 15 | $resultset = $client->terms($query); |
---|
| 16 | |
---|
| 17 | // display terms |
---|
| 18 | foreach ($resultset as $field => $terms) { |
---|
| 19 | echo '<h3>' . $field . '</h3>'; |
---|
| 20 | foreach ($terms as $term => $count) { |
---|
| 21 | echo $term . ' (' . $count . ')<br/>'; |
---|
| 22 | } |
---|
| 23 | echo '<hr/>'; |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | htmlFooter(); |
---|
Note: See
TracBrowser
for help on using the repository browser.