all groups > sql server full text search > september 2007 >
You're in the

sql server full text search

group:

Get the FTS index keywords list


Get the FTS index keywords list carignankg NO[at]SPAM gmail.com
9/5/2007 2:20:18 PM
sql server full text search: Is there a way to get the Index keywords list?

here is what i need to do

Our database contains a relative small amount of documents so we need
an application that shows ListBox of keywords sorted by index
frequency. The user selected on or many keywords from the ListBox
then launch the search.
Re: Get the FTS index keywords list Hilary Cotter
9/5/2007 2:44:27 PM
You can try something like this here:

USE [MyDatabase]
GO
declare test cursor for select PK from TableIWishToShread
open test
declare @PK int
declare @content varchar(max)
fetch next from test into @PK
while @@fetch_status=0
begin
select @content=TextData from TableIWishToShread where PK=@PK
insert into tblwords (word)
select *from dbo.ShredMe(@content)
where name not in (select word from tblwords)
fetch next from test into @PK
end
close test
deallocate test

the below script is used to build the inverted file index.

CREATE TABLE tblWordList(SubdocumentID int, WordID int, Position int)
Create table tblWords(WordID int not null identity primary key, Word
varchar(max),Little int)

Here is shredme:
USE [SonarProd]

GO

/****** Object: UserDefinedFunction [dbo].[ShredMe] Script Date: 09/05/2007
14:40:40 ******/

CREATE FUNCTION [dbo].[ShredMe](@postDescription [nvarchar](max))

RETURNS TABLE (

[Name] [nvarchar](200) NULL

) WITH EXECUTE AS CALLER

AS

EXTERNAL NAME [GoldShredder].[UserDefinedFunctions].[ShredMe]

GO

EXEC sys.sp_addextendedproperty @name=N'AutoDeployed', @value=N'yes' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'FUNCTION',@level1name=N'ShredMe'

GO

EXEC sys.sp_addextendedproperty @name=N'SqlAssemblyFile',
@value=N'ShredMe.cs' , @level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'FUNCTION',@level1name=N'ShredMe'

GO

EXEC sys.sp_addextendedproperty @name=N'SqlAssemblyFileLine', @value=22 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'FUNCTION',@level1name=N'ShredMe'



Here is the assembly. http://www.indexserverfaq.com/goldshredder.dll


--
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
[quoted text, click to view]

Re: Get the FTS index keywords list Carignan
9/6/2007 5:32:33 PM
Great tks alot

but when i run the CREATE FUNCTION....

i'm getting this:
Msg 6208, Level 16, State 1, Procedure ShredMe, Line 1
CREATE FUNCTION failed because the parameter count for the FillRow
method should be one more than the SQL declaration for the table
valued CLR function.






[quoted text, click to view]

AddThis Social Bookmark Button