ingatlancom/solr-client-symfony

Solr API client using the JSON API.

dev-master / 1.0.x-dev 2021-02-10 11:03 UTC

This package is auto-updated.

Last update: 2024-11-10 19:28:29 UTC


README

pipeline status coverage report Scrutinizer Code Quality Mutation testing badge Psalm coverage

Simple Solr client using the JSON Request API available since Solr 5.1, so this client only usable after that version.

Install

$ composer require icom/solr-client

Usage

<?php declare(strict_types=1);

use iCom\SolrClient\SolrClient;

require_once dirname(__DIR__).'/vendor/autoload.php';

$client = SolrClient::create(['base_uri' => 'http://127.0.0.1:8983/solr/core/']);

try {
    $result = $client->select('{"query": "*:*"}');

    // do something with the result
} catch (\iCom\SolrClient\Exception\Exception $e) {
    // handle errors
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate. For details please consult with our contribution guide.

License

MIT