| Kevin Blount 2006-02-22, 6:03 pm |
| I'm using this SQL query to get results for my site's search engine
(obviously <g> )..
SELECT DocTitle, vpath, path, filename, size, write, characterization,
rank FROM SCOPE(' DEEP TRAVERSAL OF "/us" ') WHERE (CONTAINS
(DocKeywords, '"practice*"') OR CONTAINS (DocTitle, '"practice*"') OR
CONTAINS ('"practice*"') > 0) ORDER BY rank DESC
I want to add an advanced option where the user can also search for
documents where the search term is NOT found...
in general database SQL I'd just add NOT after the WHERE, making
something like
SELECT DocTitle, vpath, path, filename, size, write, characterization,
rank FROM SCOPE(' DEEP TRAVERSAL OF "/us" ') WHERE NOT (CONTAINS
(DocKeywords, '"practice*"') OR CONTAINS (DocTitle, '"practice*"') OR
CONTAINS ('"practice*"') > 0) ORDER BY rank DESC
but this causes an error:
Microsoft OLE DB Provider for Indexing Service error '80040e14'
One or more errors occurred during processing of command.
can anyone advise me on changing the first query above to return
records where the keyword is NOT found?
Many thanks
|