keyword search

Results 1 to 2 of 2

Thread: keyword search

  1. #1
    Join Date
    Dec 1969

    Default keyword search

    Hi,<BR><BR>i am trying to build a record search in my asp using keywords. the associated keywords for the "products" are in their own field, like BOLT RED WHATUMACALLIT, i can get the search to work with one word, but how would i get it to work with multiple words? like RED BOLT, it would bring up all records with just RED and all BOLT and both? im not building altavista here, so it doesnt have to be to complex.... or even search for a product name (separate field) and a keyword?<BR><BR>any ideas would be hugely greatly apreciated....<BR><BR>thnx<BR>SteveF<BR><BR>ps this messageboard rox

  2. #2
    Joel M Guest

    Default RE: keyword search

    you could try using the split function on the query string... and then do something like:<BR>-------------<BR>baseSQL = "SELECT * FROM table WHERE"<BR>tempString = split(request.querystring("query"))<BR>for each item in tempString<BR><BR>baseSQL = baseSQL & "field LIKE &#039%"& item &"%&#039 "<BR><BR>next<BR>--------------------<BR><BR>there&#039s probably a small syntax error cuz I wrote that in like a minute... and you&#039ll have to work something out in the loop so that it&#039ll write the appropriate syntax ("AND"... or leave it blank for the first one) in the SQL statment... but you can see where it&#039s going..<BR><BR>hope it helps<BR>Joel M

Posting Permissions

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