孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

CREATE FULLTEXT INDEX ON SalesLT.Product

(  

  Name LANGUAGE 1033,  

  Color LANGUAGE 1033 ) 

KEY INDEX PK_Product_ProductID on (AdvFTCatalog) 

WITH (  CHANGE_TRACKING AUTO,  STOPLIST=SYSTEM )

GO

 

ALTER FULLTEXT INDEX ON SalesLT.Product ENABLE;

GO

 

--在MSSQL\FTDATA目录下修改词典,修改后为

<XML ID="Microsoft Search Thesaurus">
    <thesaurus xmlns="x-schema:tsSchema.xml">
    <diacritics_sensitive>0</diacritics_sensitive>
        <expansion>
            <sub>thin</sub>
            <sub>flat</sub>
        </expansion>
        <replacement>
            <pat>brick</pat>
            <pat>cherry</pat>
            <pat>magenta</pat>
            <pat>maroon</pat>
            <pat>rose</pat>    
            <pat>salmon</pat>
            <pat>vermilion</pat>
            <sub>red</sub>
        </replacement>        
    </thesaurus>
</XML>

 

SELECT ProductID,Name,Color

From SalesLT.Product

where FREETEXT(*,N'brick')

当查询brick时,根据词典自动换成red进行查询

 

exec sys.sp_fulltext_load_thesaurus_file 10333;

--查看支持的全部LCID列表 select * from sys.fulltext_languages

posted on 2012-11-10 18:45  孤独的猫  阅读(222)  评论(0编辑  收藏  举报