Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
iget-master committed May 12, 2015
1 parent af5f329 commit 467b45e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,18 @@ class User extends \Eloquent

####Search:
```php
$search = User::search('Sed neque labore')->get();
$search = User::search('Sed neque labore', null, true)->get();
```

####Result:
```sql
select `users`.*,

-- If third parameter is set as true, it will check if the column starts with the search
-- if then it adds relevance * 30
-- this ensures that relevant results will be at top
(case when first_name LIKE 'Sed neque labore%' then 300 else 0 end) +

-- For each column you specify makes 3 "ifs" containing
-- each word of the search input and adds relevace to
-- the row
Expand Down

0 comments on commit 467b45e

Please sign in to comment.