davispeixoto / Laravel-4-Solr by davispeixoto

Laravel 4 Apache Solr simple query client
100
9
1
Package Data
Maintainer Username: davispeixoto
Maintainer Contact: davis.peixoto@gmail.com (Davis Peixoto)
Package Create Date: 2014-04-03
Package Last Update: 2015-10-07
Language: PHP
License: MIT
Last Refreshed: 2021-09-25 03:09:00
Package Statistics
Total Downloads: 100
Monthly Downloads: 1
Daily Downloads: 0
Total Stars: 9
Total Watchers: 1
Total Forks: 4
Total Open Issues: 1

Laravel 4 Apache Solr

Build Status

This Laravel 4 package provides an interface for consuming (querying) Apache Solr via its restful interface.

Installation

Begin by installing this package through Composer. Edit your project's composer.json file to require davispeixoto/laravel-4-solr.

"require": {
	"laravel/framework": "4.1.*",
	"davispeixoto/laravel-4-solr": "dev-master"
}

Next, update Composer from the Terminal:

composer update

Once this operation completes, still in Terminal run:

php artisan config:publish davispeixoto/laravel-4-solr

Update the settings in the generated app/config/packages/davispeixoto/laravel-4-solr configuration file with solr endpoint, port, output format.

Finally add the service provider. Open app/config/app.php, and add a new item to the providers array.

'Davispeixoto\Laravel4Solr\Laravel4SolrServiceProvider'

That's it! You're all set to go. Just use:

Route::get('/test', function() {
	try {
    	Solr::setCore('products');
    	Solr::setFQ('color' , 'blue*');
    	Solr::outputFormat('json');
    	$results = Solr::getResults();
    	echo print_r($results , true);
	} catch (Exception $e) {
		Log::error($e->getMessage());
		die($e->getMessage() . $e->getTraceAsString());
	}
});

License

This library is open-sourced software licensed under the MIT license

Versioning

This project follows the Semantic Versioning