source: sandbox/expresso-solr/expressoMail1_2/solrclient/examples/2.5-terms-query.php @ 7588

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

Line 
1<?php
2
3require('init.php');
4htmlHeader();
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
18foreach ($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
26htmlFooter();
Note: See TracBrowser for help on using the repository browser.