protected function setUp()
 {
     parent::setUp();
     $this->_index = $this->_createIndex('missing');
     $docs = array(new Document('1', array('price' => 5, "color" => "blue")), new Document('2', array('price' => 8, "color" => "blue")), new Document('3', array('price' => 1)), new Document('4', array('price' => 3, "color" => "green")));
     $this->_index->getType('test')->addDocuments($docs);
     $this->_index->refresh();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->_index = $this->_createIndex("terms");
     $docs = array(new Document("1", array("color" => "blue")), new Document("2", array("color" => "blue")), new Document("3", array("color" => "red")), new Document("4", array("color" => "green")));
     $this->_index->getType("test")->addDocuments($docs);
     $this->_index->refresh();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->_index = $this->_createIndex('min');
     $docs = array(new Document('1', array('price' => 5)), new Document('2', array('price' => 8)), new Document('3', array('price' => 1)), new Document('4', array('price' => 3)));
     $this->_index->getType('test')->addDocuments($docs);
     $this->_index->refresh();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->_index = $this->_createIndex("extended_stats");
     $docs = array(new Document("1", array("price" => 5)), new Document("2", array("price" => 8)), new Document("3", array("price" => 1)), new Document("4", array("price" => 3)));
     $this->_index->getType("test")->addDocuments($docs);
     $this->_index->refresh();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->_index = $this->_createIndex("histogram");
     $docs = array(new Document("1", array("price" => 5, "color" => "blue")), new Document("2", array("price" => 8, "color" => "blue")), new Document("3", array("price" => 1, "color" => "red")), new Document("4", array("price" => 30, "color" => "green")), new Document("5", array("price" => 40, "color" => "red")), new Document("6", array("price" => 35, "color" => "green")), new Document("7", array("price" => 42, "color" => "red")), new Document("8", array("price" => 41, "color" => "blue")));
     $this->_index->getType("test")->addDocuments($docs);
     $this->_index->refresh();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->_index = $this->_createIndex("nested");
     $mapping = new Mapping();
     $mapping->setProperties(array("resellers" => array("type" => "nested", "properties" => array("name" => array("type" => "string"), "price" => array("type" => "double")))));
     $type = $this->_index->getType("test");
     $type->setMapping($mapping);
     $docs = array(new Document("1", array("resellers" => array("name" => "spacely sprockets", "price" => 5.55))), new Document("1", array("resellers" => array("name" => "cogswell cogs", "price" => 4.98))));
     $type->addDocuments($docs);
     $this->_index->refresh();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->_index = $this->_createIndex("geohash_grid");
     $mapping = new Mapping();
     $mapping->setProperties(array("location" => array("type" => "geo_point")));
     $type = $this->_index->getType("test");
     $type->setMapping($mapping);
     $docs = array(new Document("1", array("location" => array("lat" => 32.849437, "lon" => -117.271732))), new Document("2", array("location" => array("lat" => 32.79832, "lon" => -117.246648))), new Document("3", array("location" => array("lat" => 37.782439, "lon" => -122.39256))));
     $type->addDocuments($docs);
     $this->_index->refresh();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->_index = $this->_createIndex("ip_range");
     $mapping = new Mapping();
     $mapping->setProperties(array("address" => array("type" => "ip")));
     $type = $this->_index->getType("test");
     $type->setMapping($mapping);
     $docs = array(new Document("1", array("address" => "192.168.1.100")), new Document("2", array("address" => "192.168.1.150")), new Document("3", array("address" => "192.168.1.200")));
     $type->addDocuments($docs);
     $this->_index->refresh();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->_index = $this->_createIndex("nested");
     $mapping = new Mapping();
     $mapping->setProperties(array("comments" => array("type" => "nested", "properties" => array("name" => array("type" => "string"), "body" => array("type" => "string")))));
     $type = $this->_index->getType("test");
     $type->setMapping($mapping);
     $docs = array(new Document("1", array("comments" => array(array("name" => "bob", "body" => "this is bobs comment"), array("name" => "john", "body" => "this is johns comment")), "tags" => array("foo", "bar"))), new Document("2", array("comments" => array(array("name" => "bob", "body" => "this is another comment from bob"), array("name" => "susan", "body" => "this is susans comment")), "tags" => array("foo", "baz"))));
     $type->addDocuments($docs);
     $this->_index->refresh();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->_index = $this->_createIndex("date_histogram");
     $mapping = new Mapping();
     $mapping->setProperties(array("created" => array("type" => "date")));
     $type = $this->_index->getType("test");
     $type->setMapping($mapping);
     $docs = array(new Document("1", array("created" => 1390962135000)), new Document("2", array("created" => 1390965735000)), new Document("3", array("created" => 1390954935000)));
     $type->addDocuments($docs);
     $this->_index->refresh();
 }