Example #1
0
 public static function getLoader()
 {
     if (null !== self::$loader) {
         return self::$loader;
     }
     spl_autoload_register(array('ComposerAutoloaderInit8bd13e21811ac4e03034a8a5a61beace', 'loadClassLoader'), true, true);
     self::$loader = $loader = new \Composer\Autoload\ClassLoader();
     spl_autoload_unregister(array('ComposerAutoloaderInit8bd13e21811ac4e03034a8a5a61beace', 'loadClassLoader'));
     $map = (require __DIR__ . '/autoload_namespaces.php');
     foreach ($map as $namespace => $path) {
         $loader->set($namespace, $path);
     }
     $map = (require __DIR__ . '/autoload_psr4.php');
     foreach ($map as $namespace => $path) {
         $loader->setPsr4($namespace, $path);
     }
     $classMap = (require __DIR__ . '/autoload_classmap.php');
     if ($classMap) {
         $loader->addClassMap($classMap);
     }
     $loader->register(true);
     return $loader;
 }
Example #2
0
<?php

// autoload.php @generated by Composer
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit8bd13e21811ac4e03034a8a5a61beace::getLoader();
$client = new \AlgoliaSearch\Client('SMKT5MSYKT', '800636e75ea1db77a0f76817bf0743dc');
$index = $client->initIndex("contacts");
$batch = json_decode(file_get_contents("contacts.json"), true);
$index->addObjects($batch);
/** Search by firstname */
var_dump($index->search('jimmie'));
/** Search a firstname with typo */
var_dump($index->search('jimie'));
/** Search for a company */
var_dump($index->search('california paint'));
/** Search by firstname & company */
var_dump($index->search('jimmie paint'));