Solved

Index server query

Posted on 2008-06-20
3
455 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

689 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