https://github.com/phpfour/php-solr-helper
A small helper to ease querying Apache Solr using the solr-php-client library.
https://github.com/phpfour/php-solr-helper
Last synced: 8 months ago
JSON representation
A small helper to ease querying Apache Solr using the solr-php-client library.
- Host: GitHub
- URL: https://github.com/phpfour/php-solr-helper
- Owner: phpfour
- Created: 2012-05-16T10:21:02.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-06-07T08:56:15.000Z (over 12 years ago)
- Last Synced: 2025-06-25T07:02:34.490Z (8 months ago)
- Language: PHP
- Size: 175 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PHP Solr Helper
===============
This is a small helper to ease querying Apache Solr using the solr-php-client library.
Example 1:
----------
Searches the solr for records matching the two fields make and model.
$solrHelper = new \Emran\SolrHelper(new \Apache_Solr_Service('localhost', 8080, '/solr/'));
$result = $solrHelper->addSingleValueCriteria('make', 'BMW')
->addSingleValueCriteria('model', 'X5')
->search();
Example 2:
----------
Searches the solr for records matching the two fields make, model and a price range between 10000 and
20000. Also limits the fields to be returned to acode and price.
$solrHelper = new \Emran\SolrHelper(new \Apache_Solr_Service('localhost', 8080, '/solr/'));
$result = $solrHelper->addSingleValueCriteria('make', 'BMW')
->addMultiValueCriteria('model', array('X5', 'X3'))
->addRangeCriteria('price', array(20000, 50000))
->start(0)
->limit(10)
->order('price desc')
->search();