You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -562,7 +563,8 @@ class Beer < ActiveRecord::Base
562
563
using: {
563
564
:trigram => {},
564
565
:dmetaphone => {},
565
-
:tsearch => { :prefix => true }
566
+
:tsearch => { :prefix => true },
567
+
:ilike => {}
566
568
}
567
569
end
568
570
```
@@ -573,6 +575,7 @@ The currently implemented features are
573
575
*:trigram - [Trigram search](http://www.postgresql.org/docs/current/static/pgtrgm.html), which
574
576
requires the trigram extension
575
577
*:dmetaphone - [Double Metaphone search](http://www.postgresql.org/docs/current/static/fuzzystrmatch.html#AEN177521), which requires the fuzzystrmatch extension
578
+
*:iliek - Basic search using built in ilike operator
Basic search using ilike. This will look for anything containing an exact match, ie `%QUERY%`. This is useful in situations where you are looking for a substring.
985
+
986
+
```ruby
987
+
classCompany < ActiveRecord::Base
988
+
includePgSearch::Model
989
+
pg_search_scope :find_substring,
990
+
against::name,
991
+
using::ilike
992
+
end
993
+
994
+
macrohard =Company.create! name:"MacroHard"
995
+
Website.find_substring("hard") # => [macrohard]
996
+
```
997
+
979
998
### Limiting Fields When Combining Features
980
999
981
1000
Sometimes when doing queries combining different features you
0 commit comments