<commit_before># SimpleElasticSearchClient
ElasticSearch Simple Library for PHP

<commit_msg>edit README.md<commit_after># SimpleElasticSearchClient

ElasticSearch Simple Library for PHP


# Filter Search

```php
$client = new new Client([
    "end_point" => "URL"
]);

$data = $client
    ->setIndex("index name")
    ->setType("type name")
    ->createFilter() // filter search start
    ->match("status", $status) // match case
    ->setFrom($offset) // offset 
    ->setSize($limit) // limit
    ->addSort("price", $sort) // sort
    ->addAggregation("user_id") // group by
    ->attach() // filter search end
    ->search(); // execute search
```


# Data Create

```php
$client = new new Client([
    "end_point" => "URL"
]);

$query = [
    "status"  => 0,
    "price"   => 100,
    "user_id" => 1,
];

$client
    ->setIndex("index name")
    ->setType("type name")
    ->setQuery($query)
    ->create();
```


# Data Update

```php
$client = new new Client([
    "end_point" => "URL"
]);

$data = $client
    ->setIndex("index name")
    ->setType("type name")
    ->createFilter()
    ->match("user_id", $userId)
    ->attach()
    ->search();
    
$hits = $data["hits"]["hits"];
foreach ($hits as $hit) {
    
    $source = $hit["_source"];
    $source["status"] = 1;
    
    $client
        ->setIndex("index name")
        ->setType("type name")
        ->setId($hit["_id"])
        ->setQuery($source)
        ->update();
}
```
{'fraction_non_alphanumeric': 0.20041608876560332, 'fraction_numerical': 0.004160887656033287, 'mean_word_length': 2.7578125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 34, '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': '6212754', 'n_tokens_mistral': 499, 'n_tokens_neox': 485, 'n_words': 116}