Matches & Contains

ank123

New Member
Hi,

1) Could somebody tell me the differences among Matches,Begins & Contains?


Thanks in advance

ank123
 

RealHeavyDude

Well-Known Member
  1. CONTAINS: Word search, needs a word index on the field and correctly defined word break ( for example does not work out-of-the-box with UTF-8 databases ).
  2. MATCHES: Searches for a pattern within a string, you can use an asteriks as a wild card - never indexed regardless whether there is an index on the field or not and therefore will always end up scanning the whole table.
  3. BEGINS: Searches for string beginning with the given pattern - indexed when the field is indexed.
Heavy Regards, RealHeavyDude.
 
Top