Download the PHP package tamizh/laravel-es without Composer

On this page you can find all versions of the php package tamizh/laravel-es. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-es

laravel-es

The basic orm package for elasticsearch (search and CRUD functionalities) - for elasticsearch 5.0 and lesser versions

Installation

composer require tamizh/laravel-es

or add the following line in composer.json line

"tamizh/laravel-es" : "dev-master" and run

Configuration

Add the service provider to your config/app.php file:

'providers'     => [
    //...
    Tamizh\LaravelEs\ElasticsearchServiceProvider::class,
],

Add the facade to your config/app.php file:

'aliases' => [
    //...
    'Elasticsearch' => Tamizh\LaravelEs\Elasticsearch::class,
],

Publish config file using

Modifiy the config/elasticsearch.php.

Example

return [
  'hosts' => [
    env('ES_HOSTS', 'localhost:9200')
  ],
  'log_path' => 'storage/logs/',
];

Instead of extends the Model class in your models extend the Elasticsearch to use the following functions.

class Log extends Elasticsearch
{
  public $_index = 'logs*';
  public $_type = 'log';
}

Available Functions

  1. match & match_phrase - Returns the results that matches the text

  2. boolMust, boolMustNot, boolShould, boolShouldNot - Boolean queries (Equal to AND and OR in mysql)

  3. terms - Return the result that matches terms array

  4. aggs - Aggregate the result (sub aggregation not yet supported)

    Multiple aggregation can be achieved by

    Sub Aggregation can be achieved by

    available functions a) terms b) cardinality c) max d) min e) sum_bucket f) sum d) date_histogram (with interval option [default - month]) e) avg

  5. sort - Sort the query result

    or

    1. scroll - Get the Iterator Object to scroll.
  6. size - Size of the result collection

  7. highlight - To highlight the selected text

  8. first - To get first model

  9. save - To save the current model to the ES

  10. delete - To delete the current model from ES

    or

  11. query_string - query string function in ES

    in bool functions

  12. exists - exists condition functionality

  13. index - index document in ES

  14. update - update document in ES

  15. removeKey - remove unwanted key from ES

  16. script - script functionality

  17. count - get count of documents for current result

  18. range - get the result set between a range

  19. rangeBetween - get the result set between a range (Simplified version of range)

  20. from - pagination option in elasticsearch [MySQL offset] [only applicable for 10000 result window, scroll is encouraged for bigger pagination]

  21. paginate - pagination added [LengthAwarePaginator] Using this api will give you the complete function access of paginator in laravel

    Note - This can be used in the space of first 10000 result set for the current query. So if you intend to use the whole result set, then the better option is to use the scroller.

  22. search or searchRaw - To search by the raw array query

    Note - For query format check the official documentation elasticsearch PHP package

  23. topHits - to get the top hits of a aggregation

  24. multiMatch - To search on multiple fields

  25. fromType - To search on specific type

  26. find - Find the document by its ID

  27. updateByQuery (experimental) - Update the documents using query (Not production ready)

Notes

  1. Following field names are reserved - _id, _type, _index, _highlight

TODO

  1. Write test cases (stable version)
  2. Adding More functionalities
  3. Indexing functionalities
  4. Mysql query format support

All versions of laravel-es with dependencies

PHP Build Version
Package Version
Requires elasticsearch/elasticsearch Version ^2.0
monolog/monolog Version ~1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tamizh/laravel-es contains the following files

Loading the files please wait ....