Monday, March 26, 2012

Hillary's Searchpage.htm

I've started to use the code within searchpage and am having trouble with
Noisewords at the beginning and end of the search phrase.
For example:
When I specify "Bill and any Manager" the result is "Bill Manager".
When I specify "any Manager and Bill" the result is "any Manager Bill".
I use a script to put "AND" between each word in the phrase so that it can
be queried using CONTAINS.
The first instance
SELECT* from T WHERE CONTAINS(*,' "Bill" AND "Manager"') works fine.
The second instance
SELECT * from T WHERE CONTAINS(*,' "any" AND "Manager" AND "Bill" ') causes
an error - Execution of a full-text operation failed. A clause of the query
contained only ignored words.
Is there a version of the Searchpage.htm script that eliminates noisewords
at the beginning of the search phrase and also at the end?
Thanks,
Richard
Richards,
While I don't speak for Hilary and his Searchpage.htm code, you might also
want to review the following KB article: 246800 (Q246800) "INF: Correctly
Parsing Quotation Marks in FTS Queries" at
http://support.microsoft.com//defaul...b;EN-US;246800 for coding
examples (VBScript & JScript) on how to eliminate noise words from the
user's search string that is passed to SQL Server and your CONTAINS clause.
Basically, you can use client-side code to eliminate all noise words from
being passed to SQL Server FTS or use quotes to put the noise words in
"phrases" where they are truly ignored.
Regards,
John
"Richard French" <rf@.frenchfamily.net> wrote in message
news:BCDD12D0.3CF%rf@.frenchfamily.net...
> I've started to use the code within searchpage and am having trouble with
> Noisewords at the beginning and end of the search phrase.
> For example:
> When I specify "Bill and any Manager" the result is "Bill Manager".
> When I specify "any Manager and Bill" the result is "any Manager Bill".
> I use a script to put "AND" between each word in the phrase so that it can
> be queried using CONTAINS.
> The first instance
> SELECT* from T WHERE CONTAINS(*,' "Bill" AND "Manager"') works fine.
> The second instance
> SELECT * from T WHERE CONTAINS(*,' "any" AND "Manager" AND "Bill" ')
causes
> an error - Execution of a full-text operation failed. A clause of the
query
> contained only ignored words.
> Is there a version of the Searchpage.htm script that eliminates noisewords
> at the beginning of the search phrase and also at the end?
> Thanks,
> Richard
>

No comments:

Post a Comment