protected function addFilterField($index, $name, $field)
    {
        // If field already exists, make sure to merge origin / base fields
        if (isset($index->filterFields[$name])) {
            $field['base'] = $this->mergeClasses(
                $index->filterFields[$name]['base'],
                $field['base']
            );
            $field['origin'] = $this->mergeClasses(
                $index->filterFields[$name]['origin'],
                $field['origin']
            );
        }

        $index->filterFields[$name] = $field;
    }
protected function addFilterField($index, $name, $field)
    {
        // If field already exists, make sure to merge origin / base fields
        if (isset($index->filterFields[$name])) {
            $field['base'] = $this->mergeClasses(
                $index->filterFields[$name]['base'],
                $field['base']
            );
            $field['origin'] = $this->mergeClasses(
                $index->filterFields[$name]['origin'],
                $field['origin']
            );
        }

        $index->filterFields[$name] = $field;
    }
protected function addFilterField ( $ index , $ name , $ field ) { // If field already exists, make sure to merge origin / base fields if ( isset ( $ index -> filterFields [ $ name ] ) ) { $ field [ 'base' ] = $ this -> mergeClasses ( $ index -> filterFields [ $ name ] [ 'base' ] , $ field [ 'base' ] ) ; $ field [ 'origin' ] = $ this -> mergeClasses ( $ index -> filterFields [ $ name ] [ 'origin' ] , $ field [ 'origin' ] ) ; } $ index -> filterFields [ $ name ] = $ field ; }
Add new filter field to index safely.

This method will respect existing filters with the same field name that
correspond to multiple classes

@param SearchIndex $index
@param string $name Field name
@param array $field Field spec
Add new filter field to index safely .