Download the PHP package ahmedkhan847/mysqlwithelasticsearch without Composer

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

Connect MySQL With Elasticsearch using PHP

A small library to connect MySQL with Elasticsearch. Use it to sync data and do full text search.

Click here to find the API documentation for v2

Downloading the latest release

Clone the library

git clone -b release2 https://github.com/ahmedkhan847/mysqlwithelasticsearch

Now, run composer install to install the required dependencies.

Or use composer to install complete package.

composer require ahmedkhan847/mysqlwithelasticsearch:2.*

What's in release2?

In release2 package is fully redesign. Now you don't need to pass $config file to constructor. You can set index, type, sql query, sql connection dyamically. Even now you can create your own function for searching in Elasticsearch. Let's see how you can achieve the following:

Mapping in Elasticsearch

Indexing All MySQL data in Elasticsearch

By default it is using *"SELECT FROM tablename", use 'id'** as a default id column for table and elasticsearch. It is using PDO connection to fetch the data by default. If you want elasticsearch to fetch data using mysqli connection you can also use that you just need to set the connection to SyncMySql\Connection\MySQLiConnection or write your own by implementing SyncMySql\Connection. Also you can change the select query but don't forget to define an id column in it. Let's see how you can do it.

Indexing All MySQL data in Elasticsearch using MySqli Connection

Indexing Single Data in Elasticsearch

If you have want to define you own query then:

Updating in Elasticsearch

Using same technique as we do for insert you can add your own select query using setSqlQuery().

Deleting data from Elasticsearch

Searching in Elasticsearch

Creating your own search class for Elasticsearch

In order to write your own search you should extends it from SearchAbstract class and complete the public function search($query) in it.

If you want contribute, fork master branch.


All versions of mysqlwithelasticsearch with dependencies

PHP Build Version
Package Version
Requires elasticsearch/elasticsearch Version >=2
phpunit/phpunit Version 5.*
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 ahmedkhan847/mysqlwithelasticsearch contains the following files

Loading the files please wait ....