Search functions

Results 1 to 2 of 2

Thread: Search functions

  1. #1
    Join Date
    Dec 1969

    Default Search functions

    I am using Index Server to conduct a site search, and I am using ADO to display the search results. I have a function that replaces some boolean keywords, the thing is, I don&#039t know how to call it.<BR><BR>Here&#039s the function:<BR>Function FormatSQLSearch(s)<BR>‘ check and replace Lower case Boolean operators, with upper case<BR> s = replace(s, " and ", " AND ")<BR> s = replace(s, " or ", " OR ")<BR> s = replace(s, " near ", " NEAR ")<BR> s = replace(s, " not ", " NOT ")<BR>&#039if search string is specified as a literal search string, do no further processing<BR> pos=InStr(s,"""")<BR> if pos &#060;&#062; 1 then<BR> ‘ if NEAR is used, replace with NEAR()<BR> pos=InStr(s," NEAR ")<BR> if pos &#062; 0 then<BR> s = mid(s,1,pos+4) & "()" & mid(s,pos+5)<BR> else<BR> pos=InStr(s," AND ")<BR> if pos = 0 then<BR> pos=InStr(s," OR ")<BR> if pos = 0 then<BR> pos=InStr(s, " ")<BR> ‘ if no operators specified, then AND each Word<BR> if pos &#062;0 then<BR> s= replace(s," ", " AND ")<BR> else<BR> s=""""& s & """"<BR> end if<BR> end if<BR> end if<BR> end if<BR> end if<BR>FormatSQLSearch=s<BR>end function<BR><BR>So how do I get this function working? How and where do I call it? It doesn&#039t seem to be working yet - and I know I have to somehow call this function, but I just can&#039t remember how.<BR><BR>Thanks for all help

  2. #2
    Join Date
    Dec 1969

    Default RE: Search functions

    Have you tried placing FormatSQLSearch() in the main body of the code where you want to call it?<BR><BR>ex:<BR><BR>Function doStuff(foo)<BR> foo...<BR>End Function<BR><BR><BR>later in code where you want to call it....<BR><BR>&#060;%<BR>FormatSQLSearch<BR>%&#062 ;<BR><BR>Ken<BR>Ken<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts