?
Solved

Index server query

Posted on 2008-06-20
3
Medium Priority
?
460 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Accepted Solution

by:
kennethfine earned 1000 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

765 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