Friday, February 24, 2012

Dash in search string

Is it posible that dashes "-" are considering as punctuation when using
CONTAINSTABLE function? It's the behavior I see but I cannot find any text in
BOL that specify this.
This gives lots of rows:
SELECT k.KEY, * FROM ContainsTable(Request,*,N'ISSI-2007-0')
This gives no of rows:
SELECT k.KEY, * FROM ContainsTable(Request,*,N'ISSI-2007-00')
But I know that from the first resultset, full-text indexed column include
data that start with 'ISSI-2007-00'...
I would like that someone can confirm this behavior and let me know where I
can find ducomentation on that "-" behavior!
David, MCDBA
For the most part it is throw away. The rules vary from language to language
though. Basically it is broken as ISSI and 2007 and 0 (for ISSI-2007-0), and
ISSI 2007 and 00 for the second one.
I get different results from you.
create table david(pk int identity not null constraint davidpk primary key ,
charcol varchar(20))
GO
create fulltext index on david(charcol) key index davidpk
GO
insert into david(charcol) values('ISSI-2007-0')
insert into david(charcol) values('ISSI-2007-00')
GO
select * from david where contains(*,'ISSI-2007-0')--both found
GO
select * from david where contains(*,'ISSI-2007-00')--only the second is
found
GO
RelevantNoise.com - dedicated to mining blogs for business intelligence.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"David Parenteau" <DavidParenteau@.discussions.microsoft.com> wrote in
message news:F80F130B-78F1-4942-89AA-589E6419DCB7@.microsoft.com...
> Is it posible that dashes "-" are considering as punctuation when using
> CONTAINSTABLE function? It's the behavior I see but I cannot find any text
> in
> BOL that specify this.
> This gives lots of rows:
> SELECT k.KEY, * FROM ContainsTable(Request,*,N'ISSI-2007-0')
> This gives no of rows:
> SELECT k.KEY, * FROM ContainsTable(Request,*,N'ISSI-2007-00')
> But I know that from the first resultset, full-text indexed column include
> data that start with 'ISSI-2007-00'...
> I would like that someone can confirm this behavior and let me know where
> I
> can find ducomentation on that "-" behavior!
> David, MCDBA

No comments:

Post a Comment