public function dropAndCreateIndex($noMapping = false)
    {
        try {
            if ($this->indexExists()) {
                $this->dropIndex();
            }
        } catch (\Exception $e) {
            // Do nothing, our target is to create new index.
        }

        return $this->createIndex($noMapping);
    }
public function dropAndCreateIndex($noMapping = false)
    {
        try {
            if ($this->indexExists()) {
                $this->dropIndex();
            }
        } catch (\Exception $e) {
            // Do nothing, our target is to create new index.
        }

        return $this->createIndex($noMapping);
    }
public function dropAndCreateIndex ( $ noMapping = false ) { try { if ( $ this -> indexExists ( ) ) { $ this -> dropIndex ( ) ; } } catch ( \ Exception $ e ) { // Do nothing, our target is to create new index. } return $ this -> createIndex ( $ noMapping ) ; }
Tries to drop and create fresh elasticsearch index.

@param bool $noMapping Determines if mapping should be included.

@return array
Tries to drop and create fresh elasticsearch index .