Skip to content

Simple Nette extension for creating Elasticsearch Client service

License

Notifications You must be signed in to change notification settings

ublaboo/elasticsearch-nette-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

elasticsearch

Simple Nette extension for creating Elasticsearch Client service

Installation

Download extension using composer

composer require ublaboo/elasticsearch-nette-extension

Register extension in your config.neon file:

extensions:
	elasticsearch: Ublaboo\Elasticsearch\DI\ElasticsearchExtension

Configuration

Configure extension in your config.neon file:

elasticsearch:
	hosts:
		- 127.0.0.1:9200

Usage

use Elasticsearch;

class MySuperBusinessModelClass
{

	/**
	 * @var Elasticsearch\Client
	 */
	public $elasticsearchClient;


	public function __construct(Elasticsearch\Client $elasticsearchClient)
	{
		$this->elasticsearchClient = $elasticsearchClient;
	}


	public function foo(): void
	{
		/**
		 * Do something with $this->elasticsearchClient
		 */
	}

}

About

Simple Nette extension for creating Elasticsearch Client service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages