src/commands/ElasticIndexController.php
private static function prepareMapping($className)
    {
        $mapping = [];
        foreach (self::$languages as $iso_639_2t) {
            if (true === isset(self::$langToAnalyzer[$iso_639_2t])) {
                switch ($className) {
                    case StaticValues::class :
                        self::$staticMapping['properties'][Search::STATIC_VALUES_FILED]['properties']['slug_' . $iso_639_2t] = self::$slugMap;
                        self::$staticValueMap['analyzer'] = self::$langToAnalyzer[$iso_639_2t];
                        self::$staticMapping['properties'][Search::STATIC_VALUES_FILED]['properties']['value_' . $iso_639_2t] = self::$staticValueMap;
                        $mapping = self::$staticMapping;
                        break;
                    case EAV::class :
                        self::$eavValueMap['analyzer'] = self::$langToAnalyzer[$iso_639_2t];
                        self::$eavMapping['properties'][Search::EAV_FIELD]['properties']['str_value_' . $iso_639_2t] = self::$staticValueMap;
                        self::$eavMapping['properties'][Search::EAV_FIELD]['properties']['txt_value_' . $iso_639_2t] = self::$staticValueMap;
                        $mapping = self::$eavMapping;
                        break;
                }
            }
        }
        return $mapping;
    }
private static function prepareMapping($className)
    {
        $mapping = [];
        foreach (self::$languages as $iso_639_2t) {
            if (true === isset(self::$langToAnalyzer[$iso_639_2t])) {
                switch ($className) {
                    case StaticValues::class :
                        self::$staticMapping['properties'][Search::STATIC_VALUES_FILED]['properties']['slug_' . $iso_639_2t] = self::$slugMap;
                        self::$staticValueMap['analyzer'] = self::$langToAnalyzer[$iso_639_2t];
                        self::$staticMapping['properties'][Search::STATIC_VALUES_FILED]['properties']['value_' . $iso_639_2t] = self::$staticValueMap;
                        $mapping = self::$staticMapping;
                        break;
                    case EAV::class :
                        self::$eavValueMap['analyzer'] = self::$langToAnalyzer[$iso_639_2t];
                        self::$eavMapping['properties'][Search::EAV_FIELD]['properties']['str_value_' . $iso_639_2t] = self::$staticValueMap;
                        self::$eavMapping['properties'][Search::EAV_FIELD]['properties']['txt_value_' . $iso_639_2t] = self::$staticValueMap;
                        $mapping = self::$eavMapping;
                        break;
                }
            }
        }
        return $mapping;
    }
private static function prepareMapping ( $ className ) { $ mapping = [ ] ; foreach ( self :: $ languages as $ iso_639_2t ) { if ( true === isset ( self :: $ langToAnalyzer [ $ iso_639_2t ] ) ) { switch ( $ className ) { case StaticValues :: class : self :: $ staticMapping [ 'properties' ] [ Search :: STATIC_VALUES_FILED ] [ 'properties' ] [ 'slug_' . $ iso_639_2t ] = self :: $ slugMap ; self :: $ staticValueMap [ 'analyzer' ] = self :: $ langToAnalyzer [ $ iso_639_2t ] ; self :: $ staticMapping [ 'properties' ] [ Search :: STATIC_VALUES_FILED ] [ 'properties' ] [ 'value_' . $ iso_639_2t ] = self :: $ staticValueMap ; $ mapping = self :: $ staticMapping ; break ; case EAV :: class : self :: $ eavValueMap [ 'analyzer' ] = self :: $ langToAnalyzer [ $ iso_639_2t ] ; self :: $ eavMapping [ 'properties' ] [ Search :: EAV_FIELD ] [ 'properties' ] [ 'str_value_' . $ iso_639_2t ] = self :: $ staticValueMap ; self :: $ eavMapping [ 'properties' ] [ Search :: EAV_FIELD ] [ 'properties' ] [ 'txt_value_' . $ iso_639_2t ] = self :: $ staticValueMap ; $ mapping = self :: $ eavMapping ; break ; } } } return $ mapping ; }
Prepares language based index mappings according to languages defined in app config multilingual

@param string $className PropertyStorage class name
@return array
Prepares language based index mappings according to languages defined in app config multilingual