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

getPropertyConfig() private method

Build the property config from the field type and an optional analyzer (used for string and detected through getAnalyzers).
private getPropertyConfig ( string | null $analyzer = self::ANALYZER_UNTOUCHED ) : array
$analyzer string | null Used analyzer.
return array
    private function getPropertyConfig($analyzer = self::ANALYZER_UNTOUCHED)
    {
        $fieldMapping = ['type' => $this->getType(), 'doc_values' => true, 'norms' => ['enabled' => false]];
        if ($this->getType() == self::FIELD_TYPE_STRING && $analyzer == self::ANALYZER_UNTOUCHED) {
            $fieldMapping['index'] = 'not_analyzed';
        } elseif ($this->getType() == self::FIELD_TYPE_STRING) {
            $fieldMapping['analyzer'] = $analyzer;
            $fieldMapping['doc_values'] = false;
            $fieldMapping['index_options'] = 'docs';
            if (in_array($analyzer, [self::ANALYZER_STANDARD, self::ANALYZER_WHITESPACE])) {
                $fieldMapping['index_options'] = 'positions';
            }
            if ($analyzer !== self::ANALYZER_SORTABLE) {
                $fieldMapping['fielddata'] = ['format' => 'disabled'];
            }
        } elseif ($this->getType() == self::FIELD_TYPE_DATE) {
            $fieldMapping['format'] = implode('||', $this->dateFormats);
        }
        return $fieldMapping;
    }