2017 © Pedro Peláez
 

library psolr

A PHP client for Apache Solr.

image

cpliakas/psolr

A PHP client for Apache Solr.

  • Monday, September 12, 2016
  • by cpliakas
  • Repository
  • 1 Watchers
  • 12 Stars
  • 43,855 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 6 Forks
  • 3 Open issues
  • 15 Versions
  • 5 % Grown

The README.md

PSolr

Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version Total Downloads License, (*1)

A simple PHP client for Apache Solr that is built on top of Guzzle and inspired by RSolr., (*2)

Installation

PSolr can be installed with Composer by adding the library as a dependency to your composer.json file., (*3)

{
    "require": {
        "cpliakas/psolr": "*"
    }
}

After running php composer.phar update on the command line, include the autoloader in your PHP scripts so that the SDK classes are made available., (*4)

require_once 'vendor/autoload.php';

Please refer to the Composer's documentation for installation and usage instructions., (*5)

Usage

Client Instantiation

use PSolr\Client\SolrClient;
use PSolr\Request as Request;

// Connect to a Solr server.
$solr = SolrClient::factory(array(
    'base_url' => 'http://myserver.com:8080', // defaults to "http://localhost:8983"
    'base_path' => '/solr/myIndex',           // defaults to "/solr"
));

Searching Documents


$select = Request\Select::factory() ->setQuery('*:*') ->setStart(0) ->setRows(10) ; $response = $select->sendRequest($solr); $response->numFound();

For simple use cases:, (*6)

$response = $solr->select(array('q' => '*:*'));

Adding Documents

$add = Request\Add::factory();

$document        = new Request\Document();
$document->id    = '123';
$document->title = 'Test document';
$document->tag   = 'Category 1';
$document->tag   = 'Category 2';
$add->addDocument($document);

$response = $add->sendRequest($solr)

Deleting Documents

$response = Request\Delete::factory()
    ->addId('123')
    ->addId('456')
    ->addQuery('platform:solr')
    ->sendRequest($solr)
;

Sending Arbitrary Solr Requests

$response = $solr->get('admin/ping?wt=json')->send()->json();

Refer to Guzzle's documentation for more details on making web requests., (*7)

Refer to Apache Solr's documentation for more details on the API., (*8)

Integrations

The Versions

12/09 2016
18/02 2014

0.6.3

0.6.3.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Pliakas

solr

17/02 2014

0.6.2

0.6.2.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Pliakas

solr

17/02 2014

0.6.1

0.6.1.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Pliakas

solr

15/02 2014

0.6.0

0.6.0.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Pliakas

solr

13/02 2014

0.5.0

0.5.0.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Pliakas

solr

13/02 2014

0.4.2

0.4.2.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Pliakas

solr

12/02 2014

0.4.1

0.4.1.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Pliakas

solr

11/02 2014

0.4.0

0.4.0.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Pliakas

solr

08/10 2013

dev-solr-test

dev-solr-test https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Pliakas

solr

08/10 2013

0.3.2

0.3.2.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Pliakas

solr

03/10 2013

0.3.1

0.3.1.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

by Chris Pliakas

solr

30/09 2013

0.3.0

0.3.0.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

GPL-3.0

The Requires

 

by Chris Pliakas

solr

30/09 2013

0.2.0

0.2.0.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

GPL-3.0

The Requires

 

by Chris Pliakas

solr

28/09 2013

0.1.0

0.1.0.0 https://github.com/cpliakas/psolr

A PHP client for Apache Solr.

  Sources   Download

GPL-3.0

The Requires

 

by Chris Pliakas

solr