private function addAnalyzerSettings($settings, $type, $values)
    {
        $settings['analysis']['analyzer'][$type] = [
            'tokenizer' => 'whitespace',
            'filter' => ['lowercase', 'shingle'],
        ];

        if (!empty($values)) {
            $values = $this->prepareSynonymFilterData($values);
            $settings['analysis']['filter'][$type] = ['type' => 'synonym', 'synonyms' => $values];
            $settings['analysis']['analyzer'][$type]['filter'][] = $type;
        }

        $settings['analysis']['analyzer'][$type]['filter'][] = 'type_filter';

        return $settings;
    }
private function addAnalyzerSettings($settings, $type, $values)
    {
        $settings['analysis']['analyzer'][$type] = [
            'tokenizer' => 'whitespace',
            'filter' => ['lowercase', 'shingle'],
        ];

        if (!empty($values)) {
            $values = $this->prepareSynonymFilterData($values);
            $settings['analysis']['filter'][$type] = ['type' => 'synonym', 'synonyms' => $values];
            $settings['analysis']['analyzer'][$type]['filter'][] = $type;
        }

        $settings['analysis']['analyzer'][$type]['filter'][] = 'type_filter';

        return $settings;
    }
private function addAnalyzerSettings ( $ settings , $ type , $ values ) { $ settings [ 'analysis' ] [ 'analyzer' ] [ $ type ] = [ 'tokenizer' => 'whitespace' , 'filter' => [ 'lowercase' , 'shingle' ] , ] ; if ( ! empty ( $ values ) ) { $ values = $ this -> prepareSynonymFilterData ( $ values ) ; $ settings [ 'analysis' ] [ 'filter' ] [ $ type ] = [ 'type' => 'synonym' , 'synonyms' => $ values ] ; $ settings [ 'analysis' ] [ 'analyzer' ] [ $ type ] [ 'filter' ] [ ] = $ type ; } $ settings [ 'analysis' ] [ 'analyzer' ] [ $ type ] [ 'filter' ] [ ] = 'type_filter' ; return $ settings ; }
Append an analyzer for a thesaurus to existing settings.

@param array    $settings Original settings.
@param string   $type     Thesaurus type.
@param string[] $values   Thesaurus entries in Lucene format.

@return array
Append an analyzer for a thesaurus to existing settings .