src/Classes/Search.php
public function fields($fields = [])
    {

        $searchable = [];

        foreach ($fields as $field => $weight) {
            $weight_suffix = $weight > 1 ? "^$weight" : "";
            $searchable[] = $field . $weight_suffix;
        }

        $this->fields = $searchable;

        return $this;
    }
public function fields($fields = [])
    {

        $searchable = [];

        foreach ($fields as $field => $weight) {
            $weight_suffix = $weight > 1 ? "^$weight" : "";
            $searchable[] = $field . $weight_suffix;
        }

        $this->fields = $searchable;

        return $this;
    }
public function fields ( $ fields = [ ] ) { $ searchable = [ ] ; foreach ( $ fields as $ field => $ weight ) { $ weight_suffix = $ weight > 1 ? "^$weight" : "" ; $ searchable [ ] = $ field . $ weight_suffix ; } $ this -> fields = $ searchable ; return $ this ; }
Set searchable fields
@param array $fields
@return $this
Set searchable fields