Solved

Index server query

Posted on 2008-06-20
3
408 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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now