Currently, I have a form which searches the field called Resume_Post for Keywords which are filled in by the user in the Search-Contact page
Basically this is the code i came up with which pulls the letters entered in the Contact-Search.asp form..and display on the Contact-List.asp form
Essentitally i am trying to do a full text boolean search on mutliple keywords for the Resume field instead on just one(thats how it is done right now). So if i enter "Accountant, Java" it only search on one of them.
For some reason which i am not able to determine, it is not displaying the proper results.
So if I type in JAVA AND SQL AND VISUAL, it should display all contacts whichs MUST have those words (JAva, SQl, Visual) in the field called Resume_post. Resume_post basically holds an entire text resume.
Can anyone tell me where i might be going wrong in logic. Thanks in advance,
Code:
Dim strSearch, arrKeyWords, x
Dim strWhere, curKeyWord, arrTmp
Dim y
strSearch=request("Posted_Resume")
strSearch=Replace(strSearch, " OR ", ",")
arrKeyWords=Split(strSearch, ",")
strWhere=""
For x=0 To UBound(arrKeyWords)
curKeyWord=Replace(arrKeyWords(x), "'", "''")
If Len(curKeyWord)>0 Then
If InStr(curKeyWord, " AND ")>0 Then
arrTmp=Split(curKeyWord, " AND ")
strWhere=strWhere&"("
For y=0 To UBound(arrTmp)
strWhere=strWhere&"database.tblContacts.Posted_Resume LIKE '%"&curKeyWord&"%' "
If y<UBound(arrTmp) Then strWhere=strWhere&" AND "
Next
strWhere=strWhere&") OR "
Erase arrTmp
Else
strWhere=strWhere&"database.tblContacts.Posted_Resume LIKE '%"&curKeyWord&"%' OR "
End If
End If
Next
If Len(strWhere)>0 Then
If Where=True Then sql = sql & " And"
strWhere=Left(strWhere, Len(strWhere)-Len("OR "))
sql=sql&" ("&strWhere&")"
Where=True
End If