<commit_before>solrclient
==========

Classes for the busy PHP developer to work with Apache Solr.

Usage
-----

First construct a Guzzle HTTP client and set the base_url option to the Solr
endpoint you wish to work with. Then pass it to the SolrConnection.

```php
$guzzle = new \GuzzleHttp\Client([
    'base_url' => "http://localhost:8983/solr/entries/"
]);

$conn = new SolrConnection($guzzle);
```

It's also possible to pass some default request options, such as headers and
timeouts to the

```php
$guzzle = new \GuzzleHttp\Client([
    'base_url' => "http://localhost:8983/solr/entries/",
    'defaults' => [
        'timeout' => 10
    ]
]);

$solr = new SolrConnection($guzzle);
```

See [Guzzle documentation](http://docs.guzzlephp.org/) for all options.

<commit_msg>Minimal docs for Core in README<commit_after>solrclient
==========

Classes for the busy PHP developer to work with Apache Solr.

Construction
------------

First, you must construct a Guzzle HTTP client and set the base_url option to
the Solr endpoint you wish to work with. Then use it to create a Solr Client.

```php
use Opendi\Solr\Client\Client;

$guzzle = new \GuzzleHttp\Client([
    'base_url' => "http://localhost:8983/solr/entries/"
]);

$client = new Client($guzzle);
```

It's also possible to pass some default request options, such as headers and
timeouts to the Guzzle client.

```php
use Opendi\Solr\Client\Client;

$guzzle = new \GuzzleHttp\Client([
    'base_url' => "http://localhost:8983/solr/entries/",
    'defaults' => [
        'timeout' => 10
    ]
]);

$solr = new Client($guzzle);
```

See [Guzzle documentation](http://docs.guzzlephp.org/) for all options.

Working with cores
------------------

A `core` is solar terminology for a collection of records. To select a core, use
the `core($name)` method on the Solr Client.

```php
$core = $client->core('places');
```

The Core object offers various helper methods:

```php
// Returns core status
$client->core('places')->status();

// Deletes all records in the core
$client->core('places')->delete();

// Deletes records matching a selector
$client->core('places')->delete('name:Opendi');

// Returns number of documents in a core
$client->core('places')->count();
```

{'fraction_non_alphanumeric': 0.15836698070883803, 'fraction_numerical': 0.008972633467922835, 'mean_word_length': 3.795698924731183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2417938', 'n_tokens_mistral': 746, 'n_tokens_neox': 687, 'n_words': 240}