Smile\ElasticsuiteCore\Index\Mapping::addProperty PHP Method

addProperty() private method

Append a new properties into a properties list and returned the updated map.
private addProperty ( array $properties, string $propertyName, string $propertyType, array $analyzers = [] ) : array
$properties array Initial properties list.
$propertyName string New property name.
$propertyType string New property type.
$analyzers array Property analyzers.
return array
    private function addProperty(array $properties, $propertyName, $propertyType, $analyzers = [])
    {
        $property = ['type' => FieldInterface::FIELD_TYPE_MULTI];
        foreach ($analyzers as $analyzer) {
            $subFieldName = $analyzer == FieldInterface::ANALYZER_STANDARD ? $propertyName : $analyzer;
            $property['fields'][$subFieldName] = ['type' => $propertyType, 'analyzer' => $analyzer];
        }
        $properties[$propertyName] = $property;
        return $properties;
    }