1<?php 2 3include "bootstrap.php"; 4 5$options = array( 6 'hostname' => SOLR_SERVER_HOSTNAME, 7 'login' => SOLR_SERVER_USERNAME, 8 'password' => SOLR_SERVER_PASSWORD, 9 'port' => SOLR_SERVER_PORT, 10 'path' => SOLR_SERVER_PATH, 11); 12 13$client = new SolrClient($options); 14 15$query = new SolrQuery(); 16 17$query->setTerms(true); 18 19/* Return only terms starting with $prefix */ 20$prefix = 'c'; 21 22$query->setTermsField('cat')->setTermsPrefix($prefix); 23 24$updateResponse = $client->query($query); 25 26print_r($updateResponse->getResponse()); 27