2012年3月22日星期四

Full Text Search Engine in Chinese Simplied

contains(name,'"张三"')

will not find the row in database with column named "name" and "张三" is sure there,but will find '张三一','张三二' why?

name column is sure in the fulltext category and data population is finished!ID Name Sex
-
1 张三 男
2 张三一 男
3 张三二 女
4 张三四 女
I execute the T-SQL Statement : contains(name, '"张三"'),and the Result :

ID Name Sex
-
2 张三一 男
3 张三二 女
4 张三四 女
Why the Row named 张三 is not in result?
|||While I don't read Chinese, could you reply with the full output of the following SQL code?

select objectproperty(OBJECT_ID(N'<table_name>'), 'TableFulltextItemCount')

use <your_database_name_here>
go
SELECT @.@.language
SELECT @.@.version
EXEC sp_help_fulltext_catalogs
EXEC sp_help_fulltext_tables
EXEC sp_help_fulltext_columns
EXEC sp_help <your_FT-enable_table_name_here>
go

Please, note the LCID values from sp_help_fulltext_columns for the FULLTEXT_LANGUAGE column. This information should help identify what the problem is for your Full Text Search (FTS) enabled table.

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

|||This is due to wordbreaking behaviour in Chinese Simplified wordbreaker. '张三一' is got broken into '张' and '三一'. You could try freetext instead of contains to allow some fuzziness into the query.

select * from Table1 where freetext (*, N'张三')

没有评论:

发表评论