private function checkAnalyzer($property, $expectedAnalyzer)
    {
        $isAnalyzerCorrect = true;

        if ($property['type'] == self::FIELD_TYPE_TEXT || $property['type'] == self::FIELD_TYPE_KEYWORD) {
            $isAnalyzed = $expectedAnalyzer !== self::ANALYZER_UNTOUCHED;

            if ($isAnalyzed && (!isset($property['analyzer']) || $property['analyzer'] != $expectedAnalyzer)) {
                $isAnalyzerCorrect = false;
            } elseif (!$isAnalyzed && $property['type'] !== self::FIELD_TYPE_KEYWORD) {
                $isAnalyzerCorrect = false;
            }
        }

        return $isAnalyzerCorrect;
    }
private function checkAnalyzer($property, $expectedAnalyzer)
    {
        $isAnalyzerCorrect = true;

        if ($property['type'] == self::FIELD_TYPE_TEXT || $property['type'] == self::FIELD_TYPE_KEYWORD) {
            $isAnalyzed = $expectedAnalyzer !== self::ANALYZER_UNTOUCHED;

            if ($isAnalyzed && (!isset($property['analyzer']) || $property['analyzer'] != $expectedAnalyzer)) {
                $isAnalyzerCorrect = false;
            } elseif (!$isAnalyzed && $property['type'] !== self::FIELD_TYPE_KEYWORD) {
                $isAnalyzerCorrect = false;
            }
        }

        return $isAnalyzerCorrect;
    }
private function checkAnalyzer ( $ property , $ expectedAnalyzer ) { $ isAnalyzerCorrect = true ; if ( $ property [ 'type' ] == self :: FIELD_TYPE_TEXT || $ property [ 'type' ] == self :: FIELD_TYPE_KEYWORD ) { $ isAnalyzed = $ expectedAnalyzer !== self :: ANALYZER_UNTOUCHED ; if ( $ isAnalyzed && ( ! isset ( $ property [ 'analyzer' ] ) || $ property [ 'analyzer' ] != $ expectedAnalyzer ) ) { $ isAnalyzerCorrect = false ; } elseif ( ! $ isAnalyzed && $ property [ 'type' ] !== self :: FIELD_TYPE_KEYWORD ) { $ isAnalyzerCorrect = false ; } } return $ isAnalyzerCorrect ; }
Check if an ES property as the right analyzer.

@param array  $property         ES Property.
@param string $expectedAnalyzer Analyzer expected for the property.

@return boolean
Check if an ES property as the right analyzer .