Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Full-Text Search / August 2005

Tip: Looking for answers? Try searching our database.

Is There a Quick Way to Get a Total Match Count (estimate is OK) of a SQL FullText Query?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wenbin Zhang - 13 Aug 2005 16:02 GMT
Hi,

I am using the June CTP release of SQL Server 2005 on Windows Sever 2003.

Is there a quick way to get a total natch count (estimate is OK)
of a SQL FullText query? I am working with about 10 million r
ows of simple character data.

The following SQL simply returns too slow due to disk IO on the disk
with the relational table when the number of hits is large (say half
millions)

select count(*) from CONTAINSTABLE(MyTableName, FTColumnName, '
"QueryPhrase" ')

Thanks,
Wenbin Zhang
John Kane - 15 Aug 2005 07:17 GMT
Wenbin Zhang,
Since you're using SQL Server 2005, the best way to get this type of
statistical info is from the word list in the FT Catalog via the CIDump.exe
utility (see related thread subject: cidump documentation?) and import the
output back into a SQL Server table.

If you need to use a T-SQL to determine the word count of a SQL FTS query,
instead of just using a count(*), it is faster to use a stored proc, for
example:

create proc FTS_t1 (@SearchWord varchar(7800))
as
select c1 from t1 where contains(c2, @SearchWord)
go
create proc FTSCount_t1 (@SearchWord varchar(7800))
as
set nocount on
create table #FTPrimaryKey(t1_UPK int)
insert into #FTPrimaryKey exec FTS_t1 @SearchWord
select count(*) from #FTPrimaryKey
set nocount off
go
-- example of use:
exec FTSCount_t1 '"computer"'

Hope that helps!
John
Signature

SQL Full Text Search Blog
http://spaces.msn.com/members/jtkane/

> Hi,
>
[quoted text clipped - 13 lines]
> Thanks,
> Wenbin Zhang
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.