/** * Create the test index before tests run. */ protected static function createIndex() { self::$index->create(['analysis' => ['analyzer' => MappingFactory::getCustomAnalyzers()]], true); $type = self::$index->getType('message'); $mapping = (new MappingFactory())->create(EmailMessage::schema(), 'english'); $mapping->setType($type); $mapping->send(); }