setMeta() public method

Sets the mapping _meta.
public setMeta ( array $meta )
$meta array metadata
Beispiel #1
0
 /**
  * @group functional
  */
 public function testSetMeta()
 {
     $index = $this->_createIndex();
     $type = $index->getType('test');
     $mapping = new Mapping($type, array('firstname' => array('type' => 'string', 'store' => true), 'lastname' => array('type' => 'string')));
     $mapping->setMeta(array('class' => 'test'));
     $type->setMapping($mapping);
     $mappingData = $type->getMapping();
     $this->assertEquals('test', $mappingData['test']['_meta']['class']);
     $index->delete();
 }
 /**
  * Deletes all timestamps. Parameter $dataSet is ignored.
  * TODO Needs refactoring
  *
  * @param array $dataSet
  *
  * @return void
  */
 public function delete(array $dataSet)
 {
     $mapping = new Mapping($this->index->getType($this->type));
     $mapping->setMeta(['' => ''])->send();
     // Empty mapping causes ClassCastException[java.util.ArrayList cannot be cast to java.util.Map]
 }