zrt-lab / zrt-service-solr
Zend Framework 1 Solr package
Installs: 19
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Ruby
Requires
- php: >=5.3.3
- bombayworks/zendframework1: 1.*
- solarium/solarium: 3.*
Requires (Dev)
- fabpot/php-cs-fixer: dev-master
- fzaninotto/faker: dev-master
- phpunit/dbunit: *
- phpunit/phpunit: 4.1.0
This package is auto-updated.
Last update: 2025-03-29 00:17:07 UTC
README
Why?
How to use
Add "zrtlab/zend-service-solr": "dev-develop"
to the require section of your composer.json, include the composer autoloader and you're good to go.
una de las maneras en la que se puede generar la instancia del cliente de solr Es agregando los parametros de conexion en el application.ini:
zrt.services.solr.endpoint.collection.host = 127.0.0.1 zrt.services.solr.endpoint.collection.port = 8080 zrt.services.solr.endpoint.collection.path = /solr zrt.services.solr.endpoint.collection.core = aviso zrt.services.solr.endpoint.collection.timeout = 5
Heredar el Boostrap de la siguiente clase Zrt_Application_Bootstrap_Bootstrap
<?php class Bootstrap extends Zrt_Application_Bootstrap_Bootstrap { ...
Por medio del Bootstrap se registra la instancia en el Zend_Registry con el index "zend.service.solr"
Examples
class Test_SolariumController extends Zend_Controller_Action { public function indexAction() { $client = Zend_Registry::get('zrt.service.solr'); $query = $client->createQuery($client::QUERY_SELECT); $resultset = $client->execute($query); echo 'NumFound: '.$resultset->getNumFound(); foreach ($resultset as $document) { echo '<hr/><table>'; foreach ($document as $field => $value) { if (is_array($value)) { $value = implode(', ', $value); } echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>'; } echo '</table>'; } exit; } }