/** * * {@inheritdoc} * */ public static function generateMapping(FieldType $current, $withPipeline) { if (!empty($current->getMappingOptions()) && !empty($current->getMappingOptions()['mappingOptions'])) { return [$current->getName() => $current->getMappingOptions()['mappingOptions']]; } return []; }
/** * Build an elasticsearch mapping options as an array * * @param array $options * @param FieldType $current */ public static function generateMapping(FieldType $current, $withPipeline) { return [$current->getName() => array_merge(["type" => "string"], array_filter($current->getMappingOptions()))]; }
/** * {@inheritdoc} */ public static function generateMapping(FieldType $current, $withPipeline) { $body = ["type" => "nested", "properties" => ["mimetype" => ["type" => "string", "index" => "not_analyzed"], "sha1" => ["type" => "string", "index" => "not_analyzed"], "filename" => ["type" => "string"], "filesize" => ["type" => "long"]]]; if ($withPipeline) { $body['properties']['content'] = ["type" => "text", "index" => "no", 'fields' => ['keyword' => ['type' => 'keyword', 'ignore_above' => 256]]]; } return [$current->getName() => array_merge($body, array_filter($current->getMappingOptions()))]; }
/** * {@inheritdoc} */ public static function generateMapping(FieldType $current, $withPipeline) { return [$current->getName() => array_merge(["type" => "nested", "properties" => ["mimetype" => ["type" => "string", "index" => "not_analyzed"], "sha1" => ["type" => "string", "index" => "not_analyzed"], "filename" => ["type" => "string"], "filesize" => ["type" => "integer"]]], array_filter($current->getMappingOptions()))]; }
/** * * {@inheritdoc} * */ public static function generateMapping(FieldType $current, $withPipeline) { $out = [$current->getMappingOptions()['fromDateMachineName'] => ["type" => "date", "format" => 'date_time_no_millis'], $current->getMappingOptions()['toDateMachineName'] => ["type" => "date", "format" => 'date_time_no_millis']]; if (!empty($current->getMappingOptions()['index'])) { $current->getMappingOptions()['fromDateMachineName']['index'] = $current->getMappingOptions()['index']; $current->getMappingOptions()['toDateMachineName']['index'] = $current->getMappingOptions()['index']; } if ($current->getMappingOptions()['nested']) { $out = [$current->getName() => ["type" => "nested", "properties" => $out]]; } return $out; }