views:

306

answers:

2

When i execute the following sql, nothing happens:

select * from docs
where freetext(*, 'my search string')

I know that "my search string" is in a field in a table.

The table docs is added to my catalog. The field to search in contains html content.

+1  A: 

Ensure that your catalog is up-to-date. Full Text catalogs have to be updated, either with an incremental update or a full population. SQL Server 2005 also has automatically updating catalogs, but they are not set to this by default and these have serious performance implications.

Adam Robinson
I am using sql server 2008 express. And how do I update the catalog?
Martijn
http://technet.microsoft.com/en-us/library/ms189801.aspx. Have a look at 'start_full' and 'start_incremental'
Adam Robinson
Thnx, I think trhat did the trick, but I can still search on HTML tags. This may not be possible. How do I make sure that html tags cannot be found?
Martijn
I'm not sure what you mean...do you want to make sure that the data can't contain HTML? That's better done on the code side when the data is inserted/updated.
Adam Robinson
A html document is stored in my database field. So when I search on 'html' this may not result in a match, since this is a html tag. When I search on 'abc def ghi' this may be found, because this ain't html.
Martijn
Are you saying "may not" because you've seen that it doesn't? The engine shouldn't be doing any HTML specific filtering.
Adam Robinson
When I search on 'html' I have a match. This may not be possible. I know this is the html tag, because in my (plain) document I don't have the word 'html'. PS: Sorry for my bad English
Martijn
So you're saying that you want to exclude HTML tags from your search? If that's the case then, unfortunately, that isn't really possible.
Adam Robinson
Yes that's what I am saying. But if that isn't possible, than what is the IFilter for? I read something about it, but don't know much about it..
Martijn
The IFilter interface is used by the Windows Indexing Service (which is what's used by SQL Server 2005 for full-text indexing, but NOT for 2008). I don't think that you can use this in SQL Server's full-text indexing, which only exposes a subset of this functionality.If you wouldn't mind, if this has solved your issue please remember to mark it as the answer :)
Adam Robinson
Done :) I have alreadey added a table to my catalog. Now I want another column of the same table added to the catalog. How do I do this?
Martijn
You should just be able to select the other column in the same way that you selected the first.
Adam Robinson
I've done everything by commands / stored procedures. I don't know how to do it else..
Martijn
+1  A: 

Have you enabled your database tables/columns for full text search?

See example in Article on freetect including examples on how to enable full text search

Halvard
I used this: EXEC sp_fulltext_database 'enable'
Martijn