Helpful Information
 
 
Category: ASP Programming
Index Server Search Query

Hey guys,

I'm having trouble getting my head around the query language for an Index Server Search w/ASP.

I have some dummy content pages that have text like "this file contains things" and "this file contains stuff".

I've tried these two queries:



SELECT DocTitle, VPath, Path, Filename, Rank FROM SCOPE('DEEP TRAVERSAL OF "c:\inetpub\wwwroot\"')
WHERE ((CONTAINS(' "file contains" ') >0)
AND ((Path NOT LIKE '%\_vti%') AND (Path NOT LIKE '%\_private%') AND (Filename NOT LIKE 'search.asp')))
ORDER BY Rank DESC


And:



SELECT DocTitle, VPath, Path, Filename, Rank FROM SCOPE('DEEP TRAVERSAL OF "c:\inetpub\wwwroot\"')
WHERE ((CONTAINS(' "file" AND "contains" ') >0)
AND ((Path NOT LIKE '%\_vti%') AND (Path NOT LIKE '%\_private%') AND (Filename NOT LIKE 'search.asp')))
ORDER BY Rank DESC


With neither returning results.

If I query just "file" or "fil*" I get matches fine.

Also, if I query "*ile" I get no matches.

Any idea where I'm going wrong? Any help would be very much appreciated.

CONTAINS takes several parameters, and the first is the name of the column you want to look at. This seems to be missing in your code, unless I've misunderstood your column names. I'd check your syntax for starters:

http://doc.ddart.net/mssql/sql70/ca-co_15.htm










privacy (GDPR)