Wednesday, March 28, 2012

Help with SQL Contains clause

why does this
Select * from cv_Volunteer_Section where
CONTAINS(listingdescription, ' "a/p" OR "a/r" OR "bookkeeper" OR "accounting
clerk" ')
return this error?
Server: Msg 7619, Level 16, State 1, Line 2
The query contained only ignored words.
Is there away to prevent the error by editing the clause?
Thanks in advance
SanjaySanjay,
What is the version of SQL Server and on what OS platform do you have it
installed? Could you post the full output of -- SELECT @.@.version -- as this
is most helpful info in troubleshooting SQL FTS issues.
The OS platform version is key to understanding this results of your
CONTAINS query as Win2K vs. WinXP or Win2003 ship with different OS-supplied
wordbreakers. see http://groups.google.com/groups?q=langwrbk+infosoft for
more details. Also, the language-specific noise word files, under
\FTDATA\SQLServer\Config\ (noise.enu = US_English) can have an affect on the
query as well. Specifically, are the single letters A, P and R in the
noise.enu file (assuming you're using US English as the default language)?
If so, you may want to remove the single letters from this file and then run
a Full Population and re-test your query.
Regards,
John
--
SQL Full Text Search Blog
http://spaces.msn.com/members/jtkane/
"Sanjay Pais" <spaisatnospammarketlinksolutions.com> wrote in message
news:OcZnEv#AFHA.2316@.TK2MSFTNGP15.phx.gbl...
> why does this
> Select * from cv_Volunteer_Section where
> CONTAINS(listingdescription, ' "a/p" OR "a/r" OR "bookkeeper" OR
"accounting
> clerk" ')
> return this error?
> Server: Msg 7619, Level 16, State 1, Line 2
> The query contained only ignored words.
> Is there away to prevent the error by editing the clause?
> Thanks in advance
> Sanjay
>|||Courtesy of John Kane:
http://sqljunkies.com/WebLog/jt_kan.../09/19/217.aspx
-oj
"Sanjay Pais" <spaisatnospammarketlinksolutions.com> wrote in message
news:OcZnEv%23AFHA.2316@.TK2MSFTNGP15.phx.gbl...
> why does this
> Select * from cv_Volunteer_Section where
> CONTAINS(listingdescription, ' "a/p" OR "a/r" OR "bookkeeper" OR
> "accounting clerk" ')
> return this error?
> Server: Msg 7619, Level 16, State 1, Line 2
> The query contained only ignored words.
> Is there away to prevent the error by editing the clause?
> Thanks in advance
> Sanjay
>|||Speaking of the de-vil. ;-)
-oj
"John Kane" <jt-kane@.comcast.net> wrote in message
news:OktcjHEBFHA.4004@.tk2msftngp13.phx.gbl...
> Sanjay,
> What is the version of SQL Server and on what OS platform do you have it
> installed? Could you post the full output of -- SELECT @.@.version -- as
> this
> is most helpful info in troubleshooting SQL FTS issues.
> The OS platform version is key to understanding this results of your
> CONTAINS query as Win2K vs. WinXP or Win2003 ship with different
> OS-supplied
> wordbreakers. see http://groups.google.com/groups?q=langwrbk+infosoft for
> more details. Also, the language-specific noise word files, under
> \FTDATA\SQLServer\Config\ (noise.enu = US_English) can have an affect on
> the
> query as well. Specifically, are the single letters A, P and R in the
> noise.enu file (assuming you're using US English as the default language)?
> If so, you may want to remove the single letters from this file and then
> run
> a Full Population and re-test your query.
> Regards,
> John
> --
> SQL Full Text Search Blog
> http://spaces.msn.com/members/jtkane/
>
> "Sanjay Pais" <spaisatnospammarketlinksolutions.com> wrote in message
> news:OcZnEv#AFHA.2316@.TK2MSFTNGP15.phx.gbl...
> "accounting
>|||Thank you, OJ!
It's good to be noticed! I'm now actively blogging on "SQL Full Text Search
Blog" at http://spaces.msn.com/members/jtkane/ and I've cross-posted the
below entry to "SQL Server 2000 FTS on Windows 2000 vs. Windows Server
2003..." at:
http://spaces.msn.com/members/jtkane/Blog/cns!1pWDBCiDX1uvH5ATJmNCVLPQ!158.e
ntry
Enjoy.
John
"oj" <nospam_ojngo@.home.com> wrote in message
news:#mWGuIEBFHA.2876@.TK2MSFTNGP12.phx.gbl...
> Courtesy of John Kane:
> http://sqljunkies.com/WebLog/jt_kan.../09/19/217.aspx
>
> --
> -oj
>
> "Sanjay Pais" <spaisatnospammarketlinksolutions.com> wrote in message
> news:OcZnEv%23AFHA.2316@.TK2MSFTNGP15.phx.gbl...
>|||Kewl. I'll check it out.
Cheers,
--
-oj
"John Kane" <jt-kane@.comcast.net> wrote in message
news:OpJX6TEBFHA.3708@.TK2MSFTNGP14.phx.gbl...
> Thank you, OJ!
> It's good to be noticed! I'm now actively blogging on "SQL Full Text
> Search
> Blog" at http://spaces.msn.com/members/jtkane/ and I've cross-posted the
> below entry to "SQL Server 2000 FTS on Windows 2000 vs. Windows Server
> 2003..." at:
> http://spaces.msn.com/members/jtkane/Blog/cns!1pWDBCiDX1uvH5ATJmNCVLPQ!158
.entry
> Enjoy.
> John
>|||Sql Server 7
What was interesting was that it seems like the / seems to be impacting the
searchresults however,
this worked like a charm. (notice i changed a/r or a/p to a/ra/p)
Select * from cv_Volunteer_Section where
CONTAINS(listingdescription, ' "a/pa/r" OR "bookkeeper" OR "accounting
clerk" ')
"Sanjay Pais" <spaisatnospammarketlinksolutions.com> wrote in message
news:OcZnEv%23AFHA.2316@.TK2MSFTNGP15.phx.gbl...
> why does this
> Select * from cv_Volunteer_Section where
> CONTAINS(listingdescription, ' "a/p" OR "a/r" OR "bookkeeper" OR
> "accounting clerk" ')
> return this error?
> Server: Msg 7619, Level 16, State 1, Line 2
> The query contained only ignored words.
> Is there away to prevent the error by editing the clause?
> Thanks in advance
> Sanjay
>|||Microsoft SQL Server 7.00 - 7.00.1094 (Intel X86)
May 29 2003 15:21:25
Copyright (c) 1988-2002 Microsoft Corporation
Enterprise Edition on Windows NT 4.0 (Build 1381: Service Pack 6)
Thanks John/oj
"Sanjay Pais" <spaisatnospammarketlinksolutions.com> wrote in message
news:OcZnEv%23AFHA.2316@.TK2MSFTNGP15.phx.gbl...
> why does this
> Select * from cv_Volunteer_Section where
> CONTAINS(listingdescription, ' "a/p" OR "a/r" OR "bookkeeper" OR
> "accounting clerk" ')
> return this error?
> Server: Msg 7619, Level 16, State 1, Line 2
> The query contained only ignored words.
> Is there away to prevent the error by editing the clause?
> Thanks in advance
> Sanjay
>|||Sanjay,
Yes, the "/" or forward slash does impact the search results, but it is
highly dependent upon what OS platform you are using with SQL Server 7.0,
hence the request for the SELECT @.@.version output. What you have done is to
use double quotes around your single letter queries and turn these search
words into a "phrase word - pa" query and under this condition the single
letter noise words are truly ignored, but the "pa" is considered a "word".
Hope that helps!
John
--
SQL Full Text Search Blog
http://spaces.msn.com/members/jtkane/
"Sanjay Pais" <spaisatnospammarketlinksolutions.com> wrote in message
news:eRIXv8HBFHA.3924@.TK2MSFTNGP10.phx.gbl...
> Sql Server 7
> What was interesting was that it seems like the / seems to be impacting
the
> searchresults however,
> this worked like a charm. (notice i changed a/r or a/p to a/ra/p)
> Select * from cv_Volunteer_Section where
> CONTAINS(listingdescription, ' "a/pa/r" OR "bookkeeper" OR "accounting
> clerk" ')
>
> "Sanjay Pais" <spaisatnospammarketlinksolutions.com> wrote in message
> news:OcZnEv%23AFHA.2316@.TK2MSFTNGP15.phx.gbl...
>

No comments:

Post a Comment