Google Answers Logo
View Question
 
Q: All keywords,not exact phrase using ASP with Microsoft index server searchengine ( No Answer,   0 Comments )
Question  
Subject: All keywords,not exact phrase using ASP with Microsoft index server searchengine
Category: Computers > Internet
Asked by: jamwales-ga
List Price: $20.00
Posted: 11 Sep 2005 02:18 PDT
Expires: 11 Sep 2005 10:36 PDT
Question ID: 566701
I'm working on a writing my own searchengine pages for my site.
However, I'm having a problem with the Indexing Server part of the ASP
script.

I haven't been using SQL format for querying the catalog, because I
basically lacked the documentation to do it properly that way. I've
used a script which I found and used it as a start. The amount of
documentation and proper to-the-point useful examples for such search
engine are not easy to find.

The Problem (emphasizing) is as follows: the more keywords I enter,
the more results I get. From this I conclude that it's basically an OR
query. But best is naturally an AND query, to refine the search. By
AND I _don't_ mean exact phrase. I just need results in which possibly
all given keywords appear, no matter what location in that particular
document or what order of the keywords.

I've tried @contents <keywords>, but this results in an exact phrase
situation and is very inconvenient. It just has to look for ALL
keywords instead of ANY keywords. No idea how that is achieved with
the format below.

I've tried to allow a user to use e.g. and, not and and such:
- "keyword1 and keyword2 and keyword3" would end up in "query contains
only ignored words. If I specify "keyword1 keyword2 keyword3" I would
get results tho with these three keywords and those keywords are
surely not ignored words. Also I use the Dutch noise dictionary.
- "keyword4 and keyword5" did work for me, but in this case it were
results with those words glued to eachother, kinda like @contents,
exact phrase.

With SQL format I think it would be done with LIKE %keyword1% AND LIKE
%keyword2% AND LIKE %keyword3%, but I'm too inexperienced to convert
the stuff below to a working version of that  I'd have no idea e.g.
how it's done with the #vpath stuff. Would I query "intranet" like it
were a table? I'm at a loss here beginning till end.

Basically what I need is a working example for an ALL keywords (with
order of keywords not being importnant) search, but not exact phrase.
I hope someone can help me out.

Finally, the script works fine for EXACT keyword phrase searches, and
OR keyword searches - it is just the AND keyword searches that are
driving me crazy!

thanks

Jamie

Clarification of Question by jamwales-ga on 11 Sep 2005 03:24 PDT
Part of the ASP script in shown below:
======================================

Set objQuery = Server.CreateObject("ixsso.query")
Set objUtil = Server.CreateObject("ixsso.util")

my_keyword=replace(trim(request("keyword")),"'","''")
my_option=replace(trim(request("ws4uopt")),"'","''")

if my_option="EXACT" then
my_keyword2="""" & my_keyword & """" 
    else if my_option="ALL" then
    my_keyword2=replace(my_keyword," "," AND ")
        else if my_option="ANY" then
         my_keyword2=replace(my_keyword," "," OR ")
        end if
    end if
end if 

myQuery=my_keyword2

response.write "My Keyword ["  & my_keyword2 & "]<br>"
response.write "My Query   ["  & myQuery & "]<br>"
response.write "Keywords   ["  & request("keyword") & "]<br><br>"

objQuery.Query=myQuery
objQuery.Columns = "Path, Vpath, DocTitle, Filename, Characterization,
Contents,DocKeyWords, Rank"
objQuery.SortBy = "Rank [d]"
objQuery.MaxRecords = 25
objquery.catalog="xxxxxxxxx.xx.xx"
objquery.LocaleID = objutil.ISOToLocaleID("EN-US")
objUtil.AddScopeToQuery objQuery, "/StaticPages", "deep"

Set rstemp = objQuery.CreateRecordSet("nonsequential")
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy