<commit_before><?php namespace Buonzz\Evorg;

use Elasticsearch\ClientBuilder;
use Monolog\Logger;

use Illuminate\Support\Collection;

class EventRepository{

	private $client;

	public function __construct(){

		$hosts = \Config::get('evorg.hosts');		
		$logger = ClientBuilder::defaultLogger( storage_path(). '/logs/evorg.logs', Logger::INFO);

    	$this->client = ClientBuilder::create()   // Instantiate a new ClientBuilder
                ->setHosts($hosts)      // Set the hosts
                ->setLogger($logger)
                ->build();              // Build the client object

	}

	public function create($eventName, $eventData){		

		$idxbuilder = new IndexNameBuilder();
		$indexname = $idxbuilder->build($eventName);

		$params = [
	        'index' => $indexname,
	        'type' => $eventName,
	        'body' => $eventData
	    ];

		$response = $this->client->index($params);

	} // create

	public function get_all($event_name){
	}

	public function read(){
		
	}

	public function update(){
		
	}<commit_msg>added timestamp<commit_after><?php namespace Buonzz\Evorg;

use Elasticsearch\ClientBuilder;
use Monolog\Logger;

use Illuminate\Support\Collection;

class EventRepository{

	private $client;

	public function __construct(){

		$hosts = \Config::get('evorg.hosts');		
		$logger = ClientBuilder::defaultLogger( storage_path(). '/logs/evorg.logs', Logger::INFO);

    	$this->client = ClientBuilder::create()   // Instantiate a new ClientBuilder
                ->setHosts($hosts)      // Set the hosts
                ->setLogger($logger)
                ->build();              // Build the client object

	}

	public function create($eventName, $eventData){		

		$idxbuilder = new IndexNameBuilder();
		$indexname = $idxbuilder->build($eventName);

		if(!isset($eventData['timestamp']))
			$eventData['timestamp'] = date("c");

		$params = [
	        'index' => $indexname,
	        'type' => $eventName,
	        'body' => $eventData
	    ];

		$response = $this->client->index($params);

	} // create

	public function get_all($event_name){
	}

	public function read(){
		
	}

	public function update(){
		
	}
{'fraction_non_alphanumeric': 0.14792347176854875, 'fraction_numerical': 0.0, 'mean_word_length': 2.9267399267399266, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '7624331', 'n_tokens_mistral': 688, 'n_tokens_neox': 618, 'n_words': 138}