Smile\ElasticsuiteCore\Index\Mapping\Field::getMultiFieldMappingPropertyConfig PHP Method

getMultiFieldMappingPropertyConfig() private method

Standard analyzer is used as default subfield and should always be present. If the standard analyzer is not present, no default subfield is defined.
private getMultiFieldMappingPropertyConfig ( array $analyzers ) : array
$analyzers array List of analyzers used as subfields.
return array
    private function getMultiFieldMappingPropertyConfig($analyzers)
    {
        // Setting the field type to "multi_field".
        $property = ['type' => self::FIELD_TYPE_MULTI];
        foreach ($analyzers as $analyzer) {
            // Using the analyzer name as subfield name by default.
            $subFieldName = $analyzer;
            if ($analyzer == self::ANALYZER_STANDARD && $this->isNested()) {
                // Using the field suffix as default subfield name for nested fields.
                $subFieldName = $this->getNestedFieldName();
            } elseif ($analyzer == self::ANALYZER_STANDARD) {
                // Using the field name as default subfield name for normal fields.
                $subFieldName = $this->getName();
            }
            $property['fields'][$subFieldName] = $this->getPropertyConfig($analyzer);
        }
        return $property;
    }