Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 056f95c34bae66820522c9821e5a4571 > files > 7

php-horde-Horde-ElasticSearch-1.0.2-1.fc18.noarch.rpm

<?php
/**
 * Basic example for adding a mapping to ElasticSearch
 *
 * Copyright 2011-2013 Horde LLC (http://www.horde.org/)
 *
 * @author   Chuck Hagenbuch <chuck@horde.org>
 * @license  http://www.horde.org/licenses/bsd BSD
 * @category Horde
 * @package  ElasticSearch
 */

require 'Horde/Autoloader/Default.php';

$client = new Horde_ElasticSearch_Client('http://localhost:9200/', new Horde_Http_Client());
$twitter = new Horde_ElasticSearch_Index('twitter', $client);
$user = new Horde_ElasticSearch_Type('user', $twitter);
var_dump($user->map('{
    "properties" : {
        "name" : { "type" : "string" }
    }
}'));