Discussion:
Inadequate error message: only ignored words
(too old to reply)
R. Schreurs
2007-04-24 12:46:09 UTC
Permalink
In a simple ASP.NET search page, I am offering users to enter search
terms and chooce one of the options And, Or, Exact search. I do not
want to bother them with the query language and will try to generate a
query in code. When searching with And option, the search terms are
split on white space and I create a Boolean search form that. If the
user searches, for instance, 'causes of death', the Query will be:

SELECT filename, vpath, doctitle, size, rank FROM SCOPE(' SHALLOW
TRAVERSAL OF "<path>" ') WHERE CONTAINS('causes AND of AND death')
ORDER BY rank DESC

This query will throw an exception:
"The query contained only ignored words."
ErrorCode -2147215867
Microsoft OLE DB Provider for Indexing Service

If the user changes the search terms to 'causes death', thus omitting
the stop word 'of', the query will be:
SELECT filename, vpath, doctitle, size, rank FROM SCOPE(' SHALLOW
TRAVERSAL OF "<path>" ') WHERE CONTAINS('causes AND death') ORDER BY
rank DESC
I will get a set of matches an no error.

Also, when the user specifies either of the search options Or or
Exact, he will not receive an exception. In these cases, the WHERE
clause will be CONTAINS('causes OR of OR death') or CONTAINS('"causes
of death"'), respectively.

I do not understand why the system throws an exception and I certainly
do not agree with the system when it is reporting the query only
contains ignored words.

What am I doing wrong? Should I modify the query syntax?
Hilary Cotter
2007-04-25 17:43:02 UTC
Permalink
I would try a freetext search, ie causes of death.

You might also want to remove all of the noise words from your noise word
list, replace it with a single space and then rebuild your catalog. This
will prevent such problems from occuring and increase the accuracy of your
searches.
Post by R. Schreurs
In a simple ASP.NET search page, I am offering users to enter search
terms and chooce one of the options And, Or, Exact search. I do not
want to bother them with the query language and will try to generate a
query in code. When searching with And option, the search terms are
split on white space and I create a Boolean search form that. If the
SELECT filename, vpath, doctitle, size, rank FROM SCOPE(' SHALLOW
TRAVERSAL OF "<path>" ') WHERE CONTAINS('causes AND of AND death')
ORDER BY rank DESC
"The query contained only ignored words."
ErrorCode -2147215867
Microsoft OLE DB Provider for Indexing Service
If the user changes the search terms to 'causes death', thus omitting
SELECT filename, vpath, doctitle, size, rank FROM SCOPE(' SHALLOW
TRAVERSAL OF "<path>" ') WHERE CONTAINS('causes AND death') ORDER BY
rank DESC
I will get a set of matches an no error.
Also, when the user specifies either of the search options Or or
Exact, he will not receive an exception. In these cases, the WHERE
clause will be CONTAINS('causes OR of OR death') or CONTAINS('"causes
of death"'), respectively.
I do not understand why the system throws an exception and I certainly
do not agree with the system when it is reporting the query only
contains ignored words.
What am I doing wrong? Should I modify the query syntax?
Loading...