PHP code example of apility / elasticsearch-sql-parser

1. Go to this page and download the library: Download apility/elasticsearch-sql-parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

apility / elasticsearch-sql-parser example snippets




use Apility\ElasticSearch\SQLParser;

$query = "SELECT * FROM articles WHERE published = 1 ORDER BY updated LIMIT 10";
$parsed = SQLParser::parse($query); // ElasticSearch Query DSL