PHP code example of oat-sa / lib-tao-elasticsearch

1. Go to this page and download the library: Download oat-sa/lib-tao-elasticsearch 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/ */

    

oat-sa / lib-tao-elasticsearch example snippets


sudo php vendor/oat-sa/lib-tao-elasticsearch/bin/activateElasticSearch.php <pathToTaoRoot> <host> <port> <login> <password>

"postInstall": [
    {
      "class": "\\oat\\tao\\elasticsearch\\Action\\IndexCreator",
      "params": [
        "--indexFiles",
        "/var/www/html/vendor/oat-sa/lib-tao-elasticsearch/config/index.conf.php"
      ]
    }
  ]

Add your elasticsearch host to the config/tao/search.conf.php like 
    'hosts' => array(
        'http://localhost:9200'
    ),
   
 
Add you castom settings, filters or analysis

    'settings' => array(
           'analysis' => array(
               'filter' => array(
                   'autocomplete_filter' => array(
                       'type' => 'edge_ngram',
                       'min_gram' => 1,
                       'max_gram' => 100
                   )
               ),
               'analyzer' => array(
                   'autocomplete' => array(
                       'type' => 'custom',
                       'tokenizer' => 'standard',
                       'filter' => array(
                           'lowercase',
                           'autocomplete_filter'
                       )
                   )
               )
           )
       ),
    'isMap' => true