src/Searchable.php
public static function search($query, $callback = null)
    {
        $softDelete = static::usesSoftDelete() && config('scout.soft_delete', false);

        if ($query == '*') {
            return new FilterBuilder(new static, $callback, $softDelete);
        } else {
            return new SearchBuilder(new static, $query, $callback, $softDelete);
        }
    }
public static function search($query, $callback = null)
    {
        $softDelete = static::usesSoftDelete() && config('scout.soft_delete', false);

        if ($query == '*') {
            return new FilterBuilder(new static, $callback, $softDelete);
        } else {
            return new SearchBuilder(new static, $query, $callback, $softDelete);
        }
    }
public static function search ( $ query , $ callback = null ) { $ softDelete = static :: usesSoftDelete ( ) && config ( 'scout.soft_delete' , false ) ; if ( $ query == '*' ) { return new FilterBuilder ( new static , $ callback , $ softDelete ) ; } else { return new SearchBuilder ( new static , $ query , $ callback , $ softDelete ) ; } }
Execute the search.

@param string $query
@param callable|null $callback
@return \ScoutElastic\Builders\FilterBuilder|\ScoutElastic\Builders\SearchBuilder
Execute the search .