Solved

Index server query

Posted on 2008-06-20
3
448 Views
Last Modified: 2008-09-17
I have script that returns results from search form querying my IIS index server catalog.
Currently i can use a single keyword search and  I would like the query to be able to search multiple words such as "Senior Analyst", where curerntly I can only search for either "Senior" or "Analyst"

Thank you all in adavnce

My current code is bellow
sSearchString = Request.Form("query")
Const SEARCH_CATALOG = "All" 'remember to change this
%>
 <%
Set oQuery = Server.CreateObject("IXSSO.Query")
oQuery.Catalog = SEARCH_CATALOG
oQuery.Query = "@all " & sSearchString & " AND NOT #path *_* AND NOT #path *downloads* ...
0
Comment
Question by:alberte
3 Comments
 
LVL 6

Accepted Solution

by:
kennethfine earned 250 total points
ID: 21839695
Hi there,

This article will tell you exactly what you need to know:
http://www.codeproject.com/KB/aspnet/search.aspx

Though it was written for ASP.NET and you're using ASP, the concepts are identical. This is the basic query:
SELECT Rank, VPath, DocTitle, Filename, Characterization, Write
FROM SCOPE('DEEP TRAVERSAL OF "/"')
WHERE NOT CONTAINS(VPath, '"_vti_" OR ".config"')
    AND CONTAINS(Contents, '"keyword1" AND "keyword2"')
    AND CONTAINS(DocTitle, '"keyword1" AND "keyword2"')

What you are going to want to do is to build up a query with as many "contains" strings as you need. In ASP you could do that by splitting the search term into an array and looping through it, adding another  "contains" string to a concatenated search query string.

Be sure to sanetize the user's input, just to make sure they don't try any SQL injection nonsense.

I know this will work for your application because I have implemented it myself on a heavily trafficked publick site.

Good luck and cheers,
-KF
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question