[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Index server query

Posted on 2008-06-20
3
Medium Priority
?
474 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
1 Comment
 
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

Independent Software Vendors: 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

In this article, the configuration steps in Zabbix to monitor devices via SNMP will be discussed with some real examples on Cisco Router/Switch, Catalyst Switch, NAS Synology device.
In this article I will be showing you how to subnet the easiest way possible for IPv4 (Internet Protocol version 4). This article does not cover IPv6. Keep in mind that subnetting requires lots of practice and time.
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…
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…
Suggested Courses
Course of the Month18 days, 20 hours left to enroll

834 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