Friday, February 24, 2012

how to find C# in the text

I am not able to find C# using full text search of SQL 2005 beta 2
also, is there a way to enable some special words for indexing, such as c++,
c#,
thanks
--xin chne
I can find it. It seems to be case sensitive for C#(ie it can't find c#),
and it is case insensitive for c++.
Here is my repro
Create database XIN
GO
use XIN
GO
create table XIN
(pk int not null identity constraint primarykey1 primary key,
charcol char(20))
go
create fulltext catalog XIN as default
create fulltext index on XIN
(charcol) KEY INDEX primarykey1
insert into XIN (charcol) values('test')
insert into XIN (charcol) values('c')
insert into XIN (charcol) values('c++')
insert into XIN (charcol) values('c#')
insert into XIN (charcol) values('C')
insert into XIN (charcol) values('C++')
insert into XIN (charcol) values('C#')
select * from XIN where contains(*,'c') -- nothing
select * from XIN where contains(*,'c++') -- c++ and C++ returned
select * from XIN where contains(*,'c#') -- nothing
select * from XIN where contains(*,'C') -- nothing
select * from XIN where contains(*,'C++')-- c++ and C++ returned
select * from XIN where contains(*,'C#')--C# returned
--trying neutral
select * from XIN where contains(*,'c', language 0) -- nothing
select * from XIN where contains(*,'c++', language 0) -- c++ and C++
returned
select * from XIN where contains(*,'c#', language 0) -- nothing
select * from XIN where contains(*,'C', language 0) -- nothing
select * from XIN where contains(*,'C++', language 0)-- c++ and C++ returned
select * from XIN where contains(*,'C#', language 0) --C# returned
--removing c from the noise word list and rebuilding the index
select * from XIN where contains(*,'c') -- nothing
select * from XIN where contains(*,'c++') -- c++ and C++ returned
select * from XIN where contains(*,'c#') -- nothing
select * from XIN where contains(*,'C') -- nothing
select * from XIN where contains(*,'C++')-- c++ and C++ returned
select * from XIN where contains(*,'C#')--C# returned
Hilary Cotter
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
"Xin Chen" <xchen@.xtremework.com> wrote in message
news:%23P3a9wWUFHA.628@.TK2MSFTNGP09.phx.gbl...
> I am not able to find C# using full text search of SQL 2005 beta 2
> also, is there a way to enable some special words for indexing, such as
c++,
> c#,
> thanks
> --xin chne
>

No comments:

Post a Comment