From 9a404fc628ca9d6e3a261236475c9eea658ca85e Mon Sep 17 00:00:00 2001 From: basemkhirat Date: Fri, 17 Feb 2017 01:52:19 +0200 Subject: [PATCH] add native php support --- composer.json | 4 ++-- readme.md | 42 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index d80b933..f035418 100755 --- a/composer.json +++ b/composer.json @@ -1,9 +1,9 @@ { "name": "basemkhirat/elasticsearch", - "description": "laravel elasticsearch query builder", + "description": "Laravel, Lumen and Native php elasticseach query builder to build complex queries using an elegant syntax", - "keywords": ["elasticsearch", "laravel", "lumen", "scout", "fulltext", "indexing", "builder"], + "keywords": ["elasticsearch", "php", "laravel", "lumen", "scout", "fulltext", "indexing", "builder"], "license": "MIT", diff --git a/readme.md b/readme.md index a569cf3..8d22686 100755 --- a/readme.md +++ b/readme.md @@ -13,10 +13,11 @@

-## Laravel and Lumen elasticseach query builder to build complex queries using an elegant syntax +## Laravel, Lumen and Native php elasticseach query builder to build complex queries using an elegant syntax - Keeps you away from wasting your time by replacing array queries with a simple and elegant syntax you will love. - Lumen framework support. +- Native php and composer based applications support. - Supports [laravel 5.4](https://laravel.com/docs/5.4) and can be used as a [laravel scout](https://laravel.com/docs/5.4/scout) driver. - Dealing with multiple elasticsearch connections at the same time. - Supports scan and scroll queries for dealing big data. @@ -81,7 +82,44 @@ If you don't want to enable working with Lumen facades you can access the query # is similar to ES::index("my_index")->type("my_type")->get(); - + + +### Composer Installation + +You can install package with any composer-based applications + +##### 1) Install package using composer. + + composer require basemkhirat/elasticsearch + +##### 2) Creating a connection. + +``` +require "vendor/autoload.php"; + +use Basemkhirat\Elasticsearch\Connection; + +$connection = Connection::create([ + 'servers' => [ + [ + "host" => '127.0.0.1', + "port" => 9200, + 'user' => '', + 'pass' => '', + 'scheme' => 'http', + ] + ], + 'index' => 'my_index', + 'type' => 'my_type', +]); + +# access the query builder using created connection + +$documents = $connection->search("hello")->get(); + +``` + + ## Configuration