src/Marshaler/Elastica/MappingFactory.php
protected function mapUsingFormat(Field $field, \stdClass $rootObject, $path = null)
    {
        switch ($field->getFormat()->getValue()) {
            case Format::DATE:
            case Format::DATE_TIME:
                return $this->types['date-time'];

            /**
             * String fields with these formats should use "pbj_keyword" (or something similar)
             * so searches on these fields are not case sensitive.
             *
             * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html
             * @link http://stackoverflow.com/questions/15079064/how-to-setup-a-tokenizer-in-elasticsearch
             */
            case Format::EMAIL:
            case Format::HASHTAG:
            case Format::HOSTNAME:
            case Format::SLUG:
            case Format::URI:
            case Format::URL:
            case Format::UUID:
                return ['type' => 'keyword', 'normalizer' => 'pbj_keyword', 'include_in_all' => false];

            case Format::IPV4:
            case Format::IPV6:
                return ['type' => 'ip', 'include_in_all' => false];

            default:
                if ($field->getPattern()) {
                    return ['type' => 'keyword', 'normalizer' => 'pbj_keyword', 'include_in_all' => false];
                }

                return $this->applyAnalyzer(['type' => 'text'], $field, $rootObject, $path);
        }
    }
protected function mapUsingFormat(Field $field, \stdClass $rootObject, $path = null)
    {
        switch ($field->getFormat()->getValue()) {
            case Format::DATE:
            case Format::DATE_TIME:
                return $this->types['date-time'];

            /**
             * String fields with these formats should use "pbj_keyword" (or something similar)
             * so searches on these fields are not case sensitive.
             *
             * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html
             * @link http://stackoverflow.com/questions/15079064/how-to-setup-a-tokenizer-in-elasticsearch
             */
            case Format::EMAIL:
            case Format::HASHTAG:
            case Format::HOSTNAME:
            case Format::SLUG:
            case Format::URI:
            case Format::URL:
            case Format::UUID:
                return ['type' => 'keyword', 'normalizer' => 'pbj_keyword', 'include_in_all' => false];

            case Format::IPV4:
            case Format::IPV6:
                return ['type' => 'ip', 'include_in_all' => false];

            default:
                if ($field->getPattern()) {
                    return ['type' => 'keyword', 'normalizer' => 'pbj_keyword', 'include_in_all' => false];
                }

                return $this->applyAnalyzer(['type' => 'text'], $field, $rootObject, $path);
        }
    }
protected function mapUsingFormat ( Field $ field , \ stdClass $ rootObject , $ path = null ) { switch ( $ field -> getFormat ( ) -> getValue ( ) ) { case Format :: DATE : case Format :: DATE_TIME : return $ this -> types [ 'date-time' ] ; /**
             * String fields with these formats should use "pbj_keyword" (or something similar)
             * so searches on these fields are not case sensitive.
             *
             * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html
             * @link http://stackoverflow.com/questions/15079064/how-to-setup-a-tokenizer-in-elasticsearch
             */ case Format :: EMAIL : case Format :: HASHTAG : case Format :: HOSTNAME : case Format :: SLUG : case Format :: URI : case Format :: URL : case Format :: UUID : return [ 'type' => 'keyword' , 'normalizer' => 'pbj_keyword' , 'include_in_all' => false ] ; case Format :: IPV4 : case Format :: IPV6 : return [ 'type' => 'ip' , 'include_in_all' => false ] ; default : if ( $ field -> getPattern ( ) ) { return [ 'type' => 'keyword' , 'normalizer' => 'pbj_keyword' , 'include_in_all' => false ] ; } return $ this -> applyAnalyzer ( [ 'type' => 'text' ] , $ field , $ rootObject , $ path ) ; } }
@param Field     $field
@param \stdClass $rootObject
@param string    $path

@return array
@param Field $field @param \ stdClass $rootObject @param string $path