CLASS function. Replace the passed string into an expression after the Where keyword in SQL statement:
Word search [For example: Xiao Ming]
Phrase search
Every word in the phrase will be retrieved
For example: Xiaoqiang 1 nickname 1 Xiaoqiang 1 Xiaoqiang Xiaoqiang
Logical search
Supports And and Or operators.
For example: Xiao Ming And Xiao Qiang And Xiao Qiang
Compound conditions:
For example: (Xiao Xiaoming Or Xiaoming) And (Xiaoqiang Or Xiaoxiaoqiang)
For example: (Xiao Xiaoming Or nickname) And Xiao Xiaoqiang
For example: ROOT1And (Guangdong or Beijing)
-----------------------------------------------------------
The code copy is as follows:
ClassCreateQueryString
PublicobjReg
PublicintStart
PublicstrField
PrivateobjNode2
PrivatestrText
PublicPropertyLetQueryString(strValue)
strText=Lcase(strValue)
EndProperty
PrivateSubClass_Initialize()
SetobjReg=newRegExp
strField="(Title + Article)"
EndSub
PrivateSubClass_Terminate()
SetobjReg=Nothing
EndSub
PublicDefaultFunctionGetText()
DimblnRes
DimstrSky
WithoutbjReg
.IgnoreCase=true
.Global=True
.Pattern="/s"
blnRes=.Test(strText)
EndWith
If(NotblnRes)Then
intStart=2
GetText=strField&"like'%"&strText&"%'"
Else