Download the PHP package codemix/yiielasticsearch without Composer

On this page you can find all versions of the php package codemix/yiielasticsearch. 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 yiielasticsearch

YiiElasticSearch

Elastic Search client for Yii.

Installation

Install via composer, requires php >= 5.3

Configuration

Add the following to your application config:

Also make sure, that you include the autoloader of composer. We recommend to add this line to your index.php and maybe also your yiic.php:

Make sure to modify the path so that it matches the location of your vendor/ directory.

Usage

Index your ActiveRecords

Attach the YiiElasticSearch\SearchableBehavior to any of your ActiveRecords to make it easy to index and search your normal models with elasticsearch.

Now when MyModel instances are saved or deleted they will be automatically indexed or deleted in elasticsearch as appropriate.

Define an index for a record

By default your records will be stored in an index that uses your sanitized application name (Yii::app()->name). To change it you can define

or, if you need more control, create a method

Define a type for a record

By default the lower case class name will be used as type name in elasticsearch. If you want to change that you can define

or, again, if you need more control, create a method

Customize indexed data

By default all attributes are stored in the index. If you need to customize the data that should be indexed in elasticsearch, you can override these two methods.

Query records

You can specify queries using the YiiElasticSearch\Search object. This object provides a simple OO wrapper for the vanilla elasticsearch search API.

For example:

With a search you can either perform a 'raw' query, e.g.

This will return a result set that is a very simple wrapper around the raw elastic search response.

Alternatively, when combined with a SearchableBehavior you can use data providers, e.g.

The data from $dataProvider->data is a list of ActiveRecords, just like from an ordinary CActiveDataProvider. So you can use it in any list or grid view.

Raw requests

You can also use the connection component to send raw requests to elasticsearch.

Console Maintenance

The extension comes with two simple maintenance commands that can be helpful to find out what's going on in your index. To configure them, add this to your console.php configuration:

This will allow you to use yiic elastic and yiic zerodowntimeelastic on the console. Here are the commands help:

Console Command

This is the maintenance command for the elasticSearch component.

ZeroDowntime Command

This is a zero downtime maintenance command for the elasticSearch component. More details: https://www.elastic.co/blog/changing-mapping-with-zero-downtime


All versions of yiielasticsearch with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
guzzle/guzzle Version *
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 codemix/yiielasticsearch contains the following files

Loading the files please wait ....