yii\elasticsearch\Command::deleteMapping PHP Method

deleteMapping() public method

See also: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html
public deleteMapping ( $index, $type ) : mixed
$index
$type
return mixed
    public function deleteMapping($index, $type)
    {
        return $this->db->delete([$index, '_mapping', $type]);
    }

Usage Example

示例#1
0
 /**
  * sets up the index for this record
  * @param Command $command
  * @param boolean $statusIsBoolean
  */
 public static function setUpMapping($command, $statusIsBoolean = false)
 {
     $command->deleteMapping(static::index(), static::type());
     $command->setMapping(static::index(), static::type(), [static::type() => ["_id" => ["path" => "id", "index" => "not_analyzed", "store" => "yes"], "properties" => ["name" => ["type" => "string", "index" => "not_analyzed"], "email" => ["type" => "string", "index" => "not_analyzed"], "address" => ["type" => "string", "index" => "analyzed"], "status" => $statusIsBoolean ? ["type" => "boolean"] : ["type" => "integer"]]]]);
 }
All Usage Examples Of yii\elasticsearch\Command::deleteMapping