It is relatively complex and can support a variety of logical characters, including +-andor spaces, etc., and can be added as needed. You can choose which table to search according to the conditions, and the speed has been optimized, which can be said to be very fast. Of course, because it was written before, there are many problems. Almost all SQLServer features are used in stored procedures, such as cursor (record set pagination), etc. OK, don't brag anymore, just watch the program yourself.
asp function
The code copy is as follows:
functionAnalyseKeyword(a_strSource)
dimm_strDest,m_intLoop
dimm_intBeginPos,m_intEndPos
dimm_strHead,m_strMiddle,m_strTail
m_strDest=a_strSource
'-----------------------------------------------------------------------------------------------------------------------------
'First remove the spaces at the end
m_strDest=ltrim(rtrim(m_strDest))
'Replace &,"and, etc. with +, -, spaces
m_strDest=replace(m_strDest,"&","+")
m_strDest=replace(m_strDest,"AND","+")
m_strDest=replace(m_strDest,"OR",chr(32))
m_strDest=replace(m_strDest,"NOT","-")
'Initialize the variable to make the following loop go
m_intBeginPos=1
dowhilem_intBeginPos<>0
m_intBeginPos=instr(m_strDest,chr(32))
ifm_intBeginPos<>0then'If space is found
m_strHead=rtrim(ltrim(left(m_strDest,m_intBeginPos)))
callprint("[AnalyseKeyword()]: Process space m_strHead="+m_strHead)
m_strTail=rtrim(ltrim(right(m_strDest,len(m_strDest)-m_intBeginPos)))
callprint("[AnalyseKeyword()]: Process space m_strTail="+m_strTail)