Index Server and ADO

Results 1 to 2 of 2

Thread: Index Server and ADO

  1. #1
    Join Date
    Dec 1969

    Default Index Server and ADO

    I am using ADO to format the results page of my Index Server search. Does anyone know how I can format the "where" clause in my query string to accept entries with quotation marks and/or without quotation marks? For example, if a user searches for " automobiles AND "Audi A4" ", I get an error on my results page.<BR><BR>Here&#039s the bulk of my query:<BR><BR>dim SearchString<BR>SearchString = Request.QueryString("qu")<BR>strSQL = "SELECT vpath, characterization, rank, DocTitle, filename FROM SCOPE(&#039Deep Traversal of ""/mysite/""&#039) WHERE CONTAINS (&#039"& SearchString & "&#039)&#062;0 ORDER BY rank DESC"<BR><BR>Now, using this query, if I enter 1 word to search for it works fine, if I enter more than 1 word I have to put it in quotes, but that shouldn&#039t be the case - users should have the OPTION of using quotes, and that&#039s where I get stuck.<BR><BR>I would greatly appreciate any help at all. <BR><BR>Thanks

  2. #2
    Rob Guest

    Default RE: Index Server and ADO

    Hi Kim....<BR><BR>Try this before your query statement:<BR><BR> SrchStrLen = len(SearchString)<BR><BR> if left(SearchString, 1) = chr(34) then<BR> SrchStrLen = SrchStrLen-1<BR> SearchString = right(SearchString, SrchStrLen)<BR> end if<BR><BR> if right(SearchString, 1) = chr(34) then<BR> SrchStrLen = SrchStrLen-1<BR> SearchString = left(SearchString, SrchStrLen)<BR> end if<BR><BR> if FreeText = "on" then<BR> CompSearch = "$contents " & chr(34) & SearchString & chr(34)<BR> else<BR> CompSearch = SearchString<BR> end if<BR><BR> set Q = Server.CreateObject("ixsso.Query")<BR> set util = Server.CreateObject("ixsso.Util")<BR><BR> Q.Query = CompSearch<BR> Q.SortBy = "rank[d]"<BR> Q.Columns = "DocTitle, vpath, filename, size, write, characterization, rank"<BR> Q.MaxRecords = 300<BR><BR>Regards,<BR>Rob

Posting Permissions

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