MySQL full text search equivalents to Google search: Difference between revisions

Jump to navigation Jump to search
no edit summary
mNo edit summary
No edit summary
Line 1: Line 1:


 
== AND ==
case1: Google search:  {{kbd | key = keyword1 keyword2}} same as {{kbd | key = keyword1 AND keyword2}} or {{kbd | key = keyword1 +keyword2}}. {{exclaim}} (1) The following is '''exact words''' search. (2) Replace ''column_name'' with your column name
case1: Google search:  {{kbd | key = keyword1 keyword2}} same as {{kbd | key = keyword1 AND keyword2}} or {{kbd | key = keyword1 +keyword2}}. {{exclaim}} (1) The following is '''exact words''' search. (2) Replace ''column_name'' with your column name
* Google: {{kbd | key = <nowiki>易筋經 AND 吸星大法</nowiki>}}
* Google: {{kbd | key = <nowiki>易筋經 AND 吸星大法</nowiki>}}
Line 7: Line 7:
* MySQL: {{kbd | key = <nowiki>column_name LIKE '%易筋經%吸星大法%' AND column_name LIKE '%吸星大法%易筋經%'</nowiki>}} {{exclaim}} Trivial for multiple keywords
* MySQL: {{kbd | key = <nowiki>column_name LIKE '%易筋經%吸星大法%' AND column_name LIKE '%吸星大法%易筋經%'</nowiki>}} {{exclaim}} Trivial for multiple keywords


== OR ==
case2: Google search: {{kbd | key = keyword1 OR keyword2}}
case2: Google search: {{kbd | key = keyword1 OR keyword2}}
* Google: {{kbd | key = <nowiki>易筋經 OR 吸星大法</nowiki>}}
* Google: {{kbd | key = <nowiki>易筋經 OR 吸星大法</nowiki>}}
Line 12: Line 13:
* MySQL: {{kbd | key = <nowiki>column_name LIKE '%易筋經%' OR column_name LIKE '%吸星大法%'</nowiki>}}
* MySQL: {{kbd | key = <nowiki>column_name LIKE '%易筋經%' OR column_name LIKE '%吸星大法%'</nowiki>}}


== NOT ==
case3: Google search: {{kbd | key = keyword1 NOT keyword2}} same as {{kbd | key = keyword1 -keyword2}}
case3: Google search: {{kbd | key = keyword1 NOT keyword2}} same as {{kbd | key = keyword1 -keyword2}}
* Google: {{kbd | key = <nowiki>易筋經 NOT 吸星大法</nowiki>}}
* Google: {{kbd | key = <nowiki>易筋經 NOT 吸星大法</nowiki>}}
Line 17: Line 19:
* MySQL: {{kbd | key = <nowiki>column_name LIKE '%易筋經%' AND column_name NOT LIKE '%吸星大法%'</nowiki>}}
* MySQL: {{kbd | key = <nowiki>column_name LIKE '%易筋經%' AND column_name NOT LIKE '%吸星大法%'</nowiki>}}


== * wildcard operator ==
case4: Google * wildcard operator. "Use *, an asterisk character, known as a wildcard, to match one or more words in a phrase" <ref>[http://www.googleguide.com/wildcard_operator.html Google's * Wildcard Operator - Google Guide]</ref> ([http://sqlfiddle.com/#!2/e148e/1/0 online demo])
case4: Google * wildcard operator. "Use *, an asterisk character, known as a wildcard, to match one or more words in a phrase" <ref>[http://www.googleguide.com/wildcard_operator.html Google's * Wildcard Operator - Google Guide]</ref> ([http://sqlfiddle.com/#!2/e148e/1/0 online demo])
* Google: {{kbd | key = <nowiki>狐狸*叫</nowiki>}}
* Google: {{kbd | key = <nowiki>狐狸*叫</nowiki>}}

Navigation menu