Skip to content

Commit f78bfbf

Browse files
committed
Merge pull request #16 from futureworkz/full-text-search
Postgres offers full-text searching right out of the box.
2 parents 401fd66 + e1bef68 commit f78bfbf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

rails/full-text-search.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Full-Text Search in PostgreSQL
2+
3+
Postgres offers full-text searching right out of the box.
4+
Context: We have a project with title "In hac habitasse platea dictumst"
5+
6+
```
7+
Project.where("title Ilike :title", title: "Hac Habitasse platea")
8+
=> 1 result.
9+
10+
Project.where("title Ilike :title", title: "Hac platea")
11+
=> 0 result.
12+
13+
Project.where("title @@ :title", title: "Hac platea")
14+
=> 1 result.
15+
```

0 commit comments

Comments
 (0)