2012年3月26日星期一

full text search on doc files

I have a list of word files (.doc) I am trying to us the full text
search in sql server to find key words in these word documents. I have
a Windows XP and sql server installed on my machine. ( no network
server). I cant seem to get the code to work to do a search on these
files. I would really appreciate if someone can send me some code from
start to finsh so I can create the sql tables and then catolog to
search for keywords in the word files.What version of SQL Server are you using? Word documents must be stored in
columns of data type image, and another column must be present to store the
type suffix (".doc" for MS Word files).
When full-text indexing is activated for an image column the name of the
column where the suffix is stored must also be set. How this is actually don
e
depends on the SQL Server version.
SQL 2000:
sp_fulltext_column
@.tabname = '<qualified_table_name>'
,@.colname = '<column_name>'
,@.action = 'add'
,@.type_colname = '<type_column_name>'
SQL 2005:
create fulltext index on <table_name>
(<column_name> TYPE COLUMN <type_column_name>
key index <index_name>
If the index has been created appropriately, then you might also check the
SQL Error Log:
http://milambda.blogspot.com/2005/1...n-or-bybug.html
ML
http://milambda.blogspot.com/|||ML,
How do i create the table first and get the files indexed? How do I
get the files catologued? i am using sql2000 . Do i run the sql you
wrote above after the files have been imported?|||Setting up full-text indexing in SQL 2000 is very well documented in Books
Online:
http://msdn.microsoft.com/library/d... />
d_6g1f.asp
After you've created the table and enabled the database for full-text
search, you need to enable the table, then the column for full-text indexing
.
It really doesn't matter whether you set up FTI before inserting data in the
tables, or after, as long as you propagate change to the catalogue before yo
u
try to use full-text search (new rows will not be found by the engine until
the contents have been indexed).
There are several methods of propagating change to the full-text catalogue:
full propagation, incremental propagation and background propagation (with
change tracking). With background propagation new rows are indexed after
they've been inserted and changed rows are indexed after they've been
updated, but there's a performance impact and writetext/updatetext operation
s
are not detected.
To avoid the downside you could use incremental propagation by creating a
SQL Agent Job that starts incremental propagation as frequently as you need.
Are you having any specific problems? You could also ask these questions in
the dedicated newsgorup: "microsoft.public.sqlserver.fulltext".
ML
http://milambda.blogspot.com/|||ML,
I have looked through the link, still not getting it to work. I guess
i need some code, from start to finish, loading the file from the
c:\... and then running the sql. Anything you may have would be
extremely helpful..thanks|||The link I sent you will help you set up full-text indexing, but the actual
method of inserting MS Word documents into the table depends on your client
application.
If you need to insert blobs through T-SQL, you could use BULK INSERT:
http://msdn.microsoft.com/library/d...br />
4fec.asp
Also make sure you create the format file in accordance to this KB article:
http://support.microsoft.com/defaul...kb;en-us;271344
Information on using format files:
http://msdn.microsoft.com/library/d...>
bcp_9yat.asp
ML
http://milambda.blogspot.com/

没有评论:

发表评论