protected function addMissingWeights(array $columns)
    {
        $parsed = [];

        foreach ($columns as $column => $weight) {
            if (is_numeric($column)) {
                list($column, $weight) = [$weight, $this->weight];
            }

            $parsed[$column] = $weight;
        }

        return $parsed;
    }
protected function addMissingWeights(array $columns)
    {
        $parsed = [];

        foreach ($columns as $column => $weight) {
            if (is_numeric($column)) {
                list($column, $weight) = [$weight, $this->weight];
            }

            $parsed[$column] = $weight;
        }

        return $parsed;
    }
protected function addMissingWeights ( array $ columns ) { $ parsed = [ ] ; foreach ( $ columns as $ column => $ weight ) { if ( is_numeric ( $ column ) ) { list ( $ column , $ weight ) = [ $ weight , $ this -> weight ] ; } $ parsed [ $ column ] = $ weight ; } return $ parsed ; }
Add search weight to the columns if missing.

@param array $columns
Add search weight to the columns if missing .