开发者

SQL Full Text search on HTML/XML data

I have a sql full text catalog on a cms database (SQL 2005). The database holds the CMS page cont开发者_JAVA技巧ent within a ntext column which is part of the full text catalog. As expected the searching takes into account the xml tags within the page content so searching for "H1" returns all the pages with H1 tags.

Is it possible to apply filters within the full text search to only index data within the xml tags.

I can see it is possible for SQL full text search to index/search .html binary types or xml columns. However as you can see the setup is slightly different to this.

Many Thanks,

Adam


Unfortunately, you can't change away from the default "text" iFilter on a text/varchar ntext/nvarchar column.

If you can't change the data type of the column to varbinary, your next-best bet might be to add the HTML tag names as stop words, so they get ignored during indexing and searching.

I should add that ntext has been deprecated, so you will need to move away from it eventually anyway.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜